Beginners - August 2009 (Page 10)

Improving my (hopefully) cross-platform Sleep function:
 
I was trying to think of a way to sleep for a certain amount of time in milleseconds without using the existing sleep function (Windows only). Here it is, it ca...
[4 replies] Last: Ah, well, I had a good attempt at it. I'll have a look at how the W... (by chrisname)
creating grade array
 
I need to create a program that will execute displaying a column with the student id, exam scores and so forth. this is roughly what i would need the table to l...
[1 reply] : Your code should like that: ...... examscore = 10; examscore = 20... (by a20365354)
Why can't you add two string literals?
 
I know that string s4 = "hello" + ", "; and string s6 = "hello" + ", " + s2; are illegal and do understand why string s5 = s1 + "...
[4 replies] Last: Of course! The bulb finally lights! The bottom line: "You cannot overl... (by therefore)
ASCI code in array
 
hello.. I am new here in cplusplus.com.. and I'm here to ask a question regarding with our project in school "the ASCI code in array form".. please help me to g...
[4 replies] Last: ok..i'll try to do it..thanks.. (by honeykimmie)
Billy isnt making sense (tutorial question, arrays)
 
Somehow, this code isnt making sense to me: // arrays example #include <iostream> using namespace std; int billy = {16, 2, 77, 40, 12071}; int n...
[2 replies] Last: Ohhhhh I see, thanks so much :D (by StopComps)
Reading a matrix from a file
 
Hey everyone! I should say first that I'm a complete beginner at C++ and this is the first project I have tried to create. I have done quite a bit of Matlab,...
[1 reply] : Try to add matrixFile.clear() which sets the file stream state to go... (by Bazzy)
#include <iostream>
 
Hi, i want to learn to code C++, but right off the bat in the tutorial, i tried copying the code into netbeans but i keep getting an error on #include <iostream...
[17 replies] Last: Didn't I post you this link already? http://www.netbeans.org/community... (by Bazzy)
general question about good/poor code practice
 
I don't really need to go into detail about what i'm making but its basically a text based fight game that will be in a loop until one person dies. Now, ther...
[3 replies] Last: Ok to be more specific: while(fighter1.get_health()>0 && fighter... (by mcleano)
question on constructor from tutorial
 
as the example 1.CRectangle rectb; // right 2. CRectangle rectb(); // wrong! 3. CRectangle rectb = new CRectangle; 4. CRectangle rectb = new CRecta...
[2 replies] Last: crystal clear. thank you very much (by chrisben)
incremental operation issues
 
Hello, This is probably a simple issue but I haven't programmed c++ in several years. The incremental operator only seems to work one direction. It will add...
[2 replies] Last: Ah, I completely forgot how that worked. Thanks for clarifying! ~ma... (by huitlacoche)
integer condtion in while loop
 
Bit of an odd request but can someone show me an example of a while loop in which the user gets asked just before for an integer input and if it isn't correct i...
[9 replies] Last: Thanks for the help guys! And I appreciate you not just giving me the ... (by mcleano)
PI - Constant
 
Is there a predefined constant existing in some library like math.h for 'pi'??
[3 replies] Last: Wow, you're right. And not in C either! (by kbw)
How long until I can start making "games"?
 
I've only recently started getting into C++ programming. I've made some attempts in the past, but due to the language being so complex and not really allowing y...
[10 replies] Last: You can do simple board games like tick-tack-toe, checkers or backgamm... (by kbw)
I can't find these files.
 
My compiler, "netbeans" cannot find iostream and idk where it could be, is there a place i can download the files? I can't progress in the tutorial until i get ...
[9 replies] Last: Well, I got the compiler working but i still dont know where to get th... (by Metruzero)
by MYST
Rand() issue
 
Hellloooo, Just working on a real basic random number 'game' if you will. it goes as follows - #include <iostream> #include <string> #include <cstdli...
[3 replies] Last: Thank you johnkravetzki. Worked perfectly. I put that line in above... (by MYST)
by boon
Pointers/Structures/Arrays and Functions AAAAH
 
Okay so I keep running into this same problem and I have tried hard to find a solution with no success. Basically, I can get pointers working with functions, bu...
[1 reply] : When I write the definition for this function and I try to write to t... (by Disch)
passing signed char as argument to function's char& failing
 
In Stroustrup's "The C++ Programming Language", exercise 6 of 5.9, I'm to pass an unsigned character and a signed character as arguments for f(char), g(char&) a...
[2 replies] Last: Is this for the sake of portability? In other words, isn't the rule be... (by therefore)
Populating array of objects in compact fashion
 
I have a class that contains a structure and a declaration of an array containing 10 of the structures. A member function of the class is supposed to populate ...
[4 replies] Last: Ok, thanks a lot for the advice , and the quick answer! (by hadoque)
C++ exercises
 
Hi all, I'm beginning to learn C++ now, and I'd like to know where can I find exercises so I can practice.
[2 replies] Last: Thank you very much. I'm gonna work in these. (by stormqueen1990)
Finding 2 Kings in the Chess Game
 
Hi, I am currently working on a chess game, and I am almost done, but all I need to do at the moment is to check my board to see if there are two kings left on ...
[6 replies] Last: cannot move without entering check = stalemate (tie) cannot move with... (by Disch)
August 2009 Pages: 1... 89101112... 17
  Archived months: [jul2009] [sep2009]

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