Beginners - November 2009 (Page 17)

problem with vector
 
Please help me solve this problem :( thank you Shape hierarchy (The first level is Shape, and the second level consists of the classes TwoDimensionalShape ...
[1 reply] : For the love of God, we will not do your homework for you! At least ma... (by mcleano)
Incrementation and user input problem
 
here is the write function of my program. Each time you write a file it add 1 to a number in another file so that the nextime you want to write a file it doesn'...
[no replies]
by robezy
terminate called after throwing an instance of 'std::bad_alloc'
 
Problem. terminate called after throwing an instance of 'std::bad_alloc' what(): St9bad_alloc Aborted My Program. #include <iostream> #inc...
[1 reply] : You're missing the 8th edge on your input data. (by kbw)
simple code, simple question
 
Here is a piece of premade code i wanted to change to get familiar with vectors. Its about computing the average of numbers the user typed into the programm....
[1 reply] : all is well but where are you calculating the average. your between fu... (by writetonsharma)
tables
 
Give me an example of an bidimensional table that could arrange the elements of each column in increasing order. (1) 1 4 5 6 8 5 4 9 1 2 7...
[4 replies] Last: write a sort function which given an array sort it in-place. now ru... (by writetonsharma)
Executing a keystroke..
 
Hello everyone. I'm entirely new to c++, pretty much started out reading up on it today. I wanted to do something basic, but I failed terribly :( Basical...
[2 replies] Last: Ugh, I'm sorry to say but that did not make me a lot wiser :/ (by dansaDisco)
by gdsimz
Trying to display all record structure values via cout..
 
Hi all, I have an assigned program to retrieve values from the user adding them to a record structure (name, ID, test scores, Average and Letter Grade). The...
[4 replies] Last: Ok I researched a bit and found that I'm to add a subscript to the str... (by gdsimz)
anything to binary
 
Hey all! I was trying to create a decimal to binary converter in c++ (and phailed misorably) I wanted to ask, has anyone created a bynary to text and text t...
[6 replies] Last: shift operator...Gotcha. Thanks. (by warhol)
leading fffff's locking controller
 
Hello, I have a temperature controller that takes high and low bytes. My code looks like this: int myTemp lowByte = myTemp & 0xFF; highByte = ( m...
[1 reply] : Use unsigned types. (by helios)
have been working on this simple code for hours now
 
Ok, I have tried so many different things with this code. I would so much appreciate any help I can get here. #include <iostream> using namespace std; int...
[4 replies] Last: Great I knew you were OK Thank you very much (by lilproblems)
by j3tt
displaying a pattern of numbers
 
I can't figure out what I need to do to display these numbers in the correct order //Displays the following pattern of numbers //2 4 6 //8 10 12 //14 16...
[4 replies] Last: hahaha crap. I didn't even look at the loop condition. I knew this all... (by j3tt)
Deleting spaces
 
I want to delete white space in a file without using isspace or skipws. Code so far: char next_symbol; while (in_stream) { in_strea...
[5 replies] Last: Thanks all for the responses! (by foncused)
TO remove extra spaces form the string.
 
Can anyone here provide me the c/c++ code for removing the excess spaces formj the string input. for ex. string string string is the input the ...
[3 replies] Last: http://www.cplusplus.com/forum/beginner/16217/ (by kbw)
by j3tt
some confusion on where to insert the "static_cast"
 
I'm just now learning to use functions. I know I probably put the static_cast converter in the wrong places, can anyone direct me> //Converts a Fahrenhei...
[6 replies] Last: Owesome! Thank you Bazzy! I hate using that static_cast stuff (by j3tt)
a little c++ programm
 
Hello. How I can create this programm: "The user enter a natural number. Ascertain, how much digits are in this number and digit's sum. Thanks a lot!
[2 replies] Last: Thanks, it help! :) (by bubliks20)
Prime Factoring
 
How do you prime factorize numbers in a c++ program? im really just a beginner so it would really help if you gave examples... oh yeah... i need it real quick...
[1 reply] : There are many algorithms available for finding prime factors or deter... (by jsmith)
Does a good program almost always has less number of lines of code?
 
or is reuseability, robustness, clearness of code, efficiency, etc more important?
[2 replies] Last: I'll expand, but on a C++ function/method level rather than a whole pr... (by jsmith)
Accessing data of container class from a member class
 
Hi, As an example, I have two classes A and B. An object of B is a member of class A (container). What is the best way to access data of container class (A) ...
[8 replies] Last: Even in a real computer, the processor knows nothing more about its w... (by kmahesh85)
How does std::map initialize its Data?
 
I noticed that std::map seems to know how to init it's data even when it is pretty complex. For example, if there is a type containing an int, even when the ...
[2 replies] Last: Via default constructors. Example: template< typename T1, typ... (by jsmith)
Battleship Game 2
 
I was wondering how you would go about placing different size ships in an array to play the game with. I need to be able to also keep track of the number of hit...
[1 reply] : you have a board here and you will have ships inside that infact multi... (by writetonsharma)
November 2009 Pages: 1... 1516171819... 25
  Archived months: [oct2009] [dec2009]

This is an archived page. To post a new message, go to the current page.