Beginners - May 2011 (Page 47)

Getting input as a char array?
 
I'm at a complete loss and don't really know where to begin. But basically what I need to do is get a 4digit positive integer and filter out incorrect inputs. ...
[14 replies] Last: of course i knew that, it was a... test? (by ascii)
by ascii
reading a string in backwards
 
im trying to add exponents (represented by a ^) to a console calculator. i can easily get the exponent, but the base is tricky. i have to go back and get the ...
[10 replies] Last: haha someday, but as you pointed out im still on calculators xD (by ascii)
Sorting multiple fields in one array
 
Hello, I have a question about sorting data with 2 out of 3 fields in a array. Example: 2 25 1000 4 10 1230 1 12 1540 2 5 1200 4 5 1250 Basica...
[6 replies] Last: Don't write a C program for this - if you are on an UNIX system, just ... (by kfmfe04)
Specific Placement of Output
 
Hi folks. I am looking for a way to control precisely where the output of a cout statement appears, and setw just isn't doing it for me. Here's the synopsis of ...
[14 replies] Last: Unfortunately, iostream formatting is a nightmare. That's why I often... (by kfmfe04)
c++ lotto program
 
Hello. i wrote a program that will compare the past several years of winning pick 3 numbers to the numbers that are in the 13 tier. what i want to add now t...
[1 reply] : I don't quite understand the question. What do you mean by hits and ti... (by GodPyro)
Help changing array values (1,2)
 
I am in a beginning C++ class in college and I need some help with a project. The project is to design a C++ program that takes a user enter sequence of non-neg...
[24 replies] Last: Ok I see. That is pretty cool! Didn't know about that data structure o... (by GodPyro)
fatal error C1004: unexpected end-of-file found
 
Hi guys, I am working with C functions and I wrote a simple program to compute the maximum and minimum of two numbers. I split the functions into separate files...
[1 reply] : SOLVED! Need an enter after the #endif! (by MamoonSaeed)
Outputting strings to a file without single quotes
 
Hey guys, I have read in tab delimited information using getline. My code looks like this: getline(inFile1, books .item_name, '\t'); //storing in an array...
[2 replies] Last: That did the trick. I completely missed the fact that I had the tab ch... (by wap1122358)
IP address incrementation
 
Hi all! I'm new to C++ and could use a little help with incrementing an IP address. I'm building a VLSM calculator. The part im having trouble with is that if ...
[1 reply] : I guess a better example of what i'm trying to get is... for instance ... (by forrest)
one or more multiply defined symbols found
 
I am having a bit of trouble with a simple program that I wrote to practice writing headers. I keep getting this error message: 1>nUnits.obj : error LNK2005...
[16 replies] Last: @kjmje04 Thanks, I did that after you suggested it. It worked :... (by Fistanantilu)
by SephX
Help with Buttons
 
Hello, I am working on this program that simulates a fox and hounds game. In this program there are four buttons, each controlling one piece to any of the fou...
[4 replies] Last: I can't believe I overlooked that! Thank you! (by SephX)
About outputting to a file
 
Is there anyway to output to a file by having one command at the end of the program instead of having to put couts to that file all over the program?
[1 reply] : ofstream::write() http://www.cplusplus.com/reference/iostream/ostream/... (by GodPyro)
Inputting files into my program
 
I need help with reading text files and displaying them on my output file Example: My text file has integers listed: 9 7 5 14 29 30 27 47 then my program ...
[7 replies] Last: Use cout e.g. std::cout << fromFile; Here is a tutorial: http://w... (by GodPyro)
Getline??? I need a bit of help!
 
I am doing a program involving an unsorted list of names that I have to turn form Firstname Lastname into Lastname, Firstname. So I wrote the main program, and ...
[4 replies] Last: I used <list> because i didn't have access to your "list.cpp". From wh... (by GodPyro)
How to break it up.
 
Prompt the user to select (from a menu) the data type of a series of values which the user will eventually enter. Then, as we did in lab 8, use a switch statem...
[3 replies] Last: 3) From within the appropriate switch block, call a function to initia... (by jimmy5023)
Is this a function declaration?
 
Hi, I am not so new to c++, but I still don't recognise the following code. Maybe I have forgotten something, or maybe you guys can explain: class Digital...
[7 replies] Last: thanks everyone. I can move on now, and let this rest in peace :) no,... (by ProbePLayer)
by lare26
Simple SDL 2d Collision detection
 
I am trying to find a way to detect a collision between two sprites in a 2d SDL space shooter game. I figured if I use the height and width from the 0,0 pixel t...
[13 replies] Last: I appreciate all your help. With the information given, I can further ... (by lare26)
by ascii
returning -1 every time
 
i feel kind of stupid asking this, but why for the love of god is this program returning 0 every time...? its supposed to print the ascii value of a character ...
[4 replies] Last: :o i looked at the answer and the question was messed up. they gave y... (by ascii)
after delete can still acess the memory !!
 
All, tryig to understabd usage of new/delete with/without array, few doubts (provided as comments) , request to help make me clear, main() { int...
[2 replies] Last: @ GodPyro : It looks to me that the OP is asking a question about 'C'... (by Computergeek01)
by Gio
Catching a string or char inputted for a double
 
How can I catch a string or char which is entered when I ask for a double?
[2 replies] Last: You could also take the input as a string and cast it to a double. I... (by Computergeek01)
May 2011 Pages: 1... 45464748
  Archived months: [apr2011] [jun2011]

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