Remember my first program? Well, heres the sequel.
Printable View
Remember my first program? Well, heres the sequel.
A) What is the point of the post?
B) Why do you use define statements that are not needed?
C) Try taking the entire name as one string using getline. Therefore, the user doesn't have to hit enter twice.
*playing with his sleeves*
Huh? Ok, sure, whynot?
I ran an earlier version of this program and it worked to some extent, but the two biggest problems that I have with this program (aside from the complete lack of portability) is this:
First, redefining a common keyword just obfuscates the code, and hides spelling errors if you use an IDE that will make keywords a different color. When learning a language, use it correctly until you understand what rules you can bend and how to do so without creating new bugs. The second problem is that you make every member public in your class. If you don't care about data hiding then you might as well just use a struct and not pretend you're writing an object oriented program.Code:#define group class
group program_variables
{
public:
int mainresponse;
unsigned int age;
char name[25];
char lstname[25];
char gender[7];
char personality[25];
char hobby1[20], hobby2[20], hobby3[20];
void calculator();
void stalker();
void watch_loop();
};
-Prelude
:confused:
Yeah Jason, I said the same thing. I'm an intermediate in C++ so I know what I'm doing. The purpose of my posting my program is for you to enjoy the .exe file. If you want to correct my .cpp file e-mail me at [email protected]
My style of C++ coding is much different from you guys.
Could someone tell me what the Sleep() command does and it's syntax.....it seems quite interesting.
hey you're using STYC++ in 21 Days right? Because I see Frisky and Fout.....
>If you want to correct my .cpp file e-mail me
If you don't want comments on your code then post the .exe on the GD boards. These are discussion forums on programming, if you post code then people will discuss the code. As for emailing, don't expect it since one of the benefits of discussion is getting different persepctives as opposed to just one person offering suggestings in an email.
>Could someone tell me what the Sleep() command does and it's syntax
The sleep function is a function that simply causes a delay, the argument is the number of miliseconds that the delay will last.
-Prelude
oh cool so this would work............
int x;
x=125;
Sleep(x);
?
Yes
-Prelude
Sleep(x) is a great function. Is there another function like it?
Code:
Wake (NOW!!!);
Wake ( IN '5');
j/k I don't know :D......it is pretty cool.
uhh...I didn't laugh at that joke. Was that suppose to be funny? Was that some nerdy joke you guys do?
>Wake ( IN '5');
Or the equivalent macro
snooze();
But don't forget to include early.h
-Prelude