Beginners - April 2010 (Page 24)

Macros
 
Hi In below code i ahve define macro twice. #include<iostream> using namespace std; #define z 10 #define z 15 // Same macro as above. int m...
[9 replies] Last: Well, yes, I suppose how the preprocessor is implemented is undefined,... (by chrisname)
Thanks everyone!
 
Good day everybody.So I was making a quick program for practice, and I ended up getting side tracked and made something kinda useful. So, here's my gift to ever...
[no replies]
Why is this outputting zero's?!?!?!
 
I have written a program to input test/program grades from multiple students to calculate various average's. They are weighted: tests are 80% and programs are 2...
[7 replies] Last: I should add, that you most probably won't notice a difference with th... (by chrisname)
by Keaser
Want to make cin.get accept chars after enter is pressed
 
Hi, I will admit that this is a project that I working on for class, however, I have spend 10+ hours on this project and almost completely done. The problem I ...
[2 replies] Last: Yes this does help explain why I couldn't enter input after cin.get() ... (by Keaser)
How to cast object from class string to c_string by a function
 
I have got a problem. It seems not hard but i can not find any appropriate function to cast object from class string to c_string. Please help me, i soon have ...
[1 reply] : Look up c_str(). (by closed account jwC5fSEw)
expected unqualified-id error
 
hello, I have this testing code: #include <iostream> using namespace std; class hstates { public: double p ; int n; hstates(int s){n=s;} ...
[2 replies] Last: Well, you're not seeding your rand function or even including the libr... (by closed account jwC5fSEw)
Question about std::string erase
 
Example string "012345" If I use string.erase(0,0) the output is unchanged. If using string.erase(0,1) the output is "12345" However, if I use string.era...
[1 reply] : the second parameter is the number of characters to erase. (by jsmith)
Graphics
 
i know this is a very very newb question but how can i make a different border and graphics and text boxes because Im sick of the command prompt.
[4 replies] Last: Usually yes with everyone. The developers didn't go through all of tha... (by Computergeek01)
by anzki4
"Moving" strings, ints etc.
 
Edit: Read the end before the code. Edit 2: Read second post for shorter example. int main () { cout << "Welcome adventurer!\n\n ew game\n oad game\n u...
[2 replies] Last: Oh sorry to bother found out that above works fine. (In original code ... (by anzki4)
by bnd
can't get input from a function called within a class
 
So I have a class that displays a menu in the terminal and takes input and executes a function class interface { interface(); menu(); select(...
[1 reply] : A contents of a class are private by default. You need to declare the... (by kbw)
cant understand this program ...
 
hello ... i need help in this program Write C++ class named ‘Rectangle’ including the code of the member functions. Use private and public access specif...
[1 reply] : http://www.cplusplus.com/forum/articles/1295/ (by kbw)
by Ipolit
Deletes text in brackets from a txt file
 
Hello! I need a little help with my code. Program should open a txt file, read it and make a new one with the same text but eliminate text in brackets. Fo...
[3 replies] Last: thnx oghmaosiris . Im new to this forum... (by Ipolit)
Problem with vectors
 
I tried looking for an answer to my problem here, but couldn't get any. Hence posting this here. I have a class stream, with a private member variable vector...
[8 replies] Last: lol, I just saw your last post... (by m4ster r0shi)
Errors with code!!
 
I am having to write a program that asks the user how many students to process, then reads in the scores for two items, an exam score and lab average, for that ...
[2 replies] Last: alright I have corrected the code and have it to where it will ask for... (by cpnewbie)
C programing problem. Any assistance would be greatly appreciated.
 
I'm In my first C programing class and so far everything has been going well although now I'm stuck on an exercise. I'm not looking for someone to do it for me...
[5 replies] Last: @qtpan, if you really want to be a good at programming use the right... (by chrisname)
by Tomdon
Can't get it to Average correctly
 
Here is my code and it takes in a .txt file and separates the number by greater or less than 70. I need to get an average of those numbers as well. I don't kn...
[no replies]
having issue with random number and arrays
 
so i am supposed to have a program that creates random numbers between 1 and 10, assign the numbers to an array and then give the sum of all numbers. My questi...
[4 replies] Last: got it now, thanks. for ( roll = 0; roll < size; roll++) b = (ran... (by theMadMonster)
error
 
Hi! sorry for this newbie question. Im using Visual C++ 6 and trying to compile my first program, hello world! But this keeps coming up! whats wrong? -----...
[1 reply] : Close the instance of the program before attempting to recompile. O... (by helios)
Void Recursive -> Int Recursive Conversion
 
Below is the method I've got, however instead of using a return I'm storing the result in a global variable searchdata. This works however would not be elegant ...
[1 reply] : Sorry I would like to add that these methods are not for inorder trave... (by John Linux)
GRADE ARRAY_NEED ADVICE FAST
 
Hello. I am absolutely brandnew in c++. I am currently in the middle of my Computer Engineering class (mainly for the electronics part) but nevertheless I have ...
[6 replies] Last: Hi I am having a similar problem my code is: #include<iostream> #... (by cpnewbie)
April 2010 Pages: 1... 2223242526... 35
  Archived months: [mar2010] [may2010]

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