Thanks...that was a silly mistake on my part. :)
Type: Posts; User: madgolfertom
Thanks...that was a silly mistake on my part. :)
#include <time.h>
time_t plaintime;
tm *ptm;
time(&plaintime);
ptm = localtime(&plaintime);
if (ptm.tm_hour >= 0 && ptm.tm_hour <= 4)
{cout << "A special message!...";}
Well, I'm sorry I haven't got back to you guys in a while...thanks for the quick response!
I used Hunter's method with resize(). I don't really care about great performace, but thank you all for...
getline(cin, name);
Is what I use to get the string name. I'd like to make the program limit the name to eight characters or less, truncating the name if it's too long. I'm a bit of a newbie, help...
Wow! Thank you very much, that's exactly what I need!
Is there a way for my program to take the time from the user's computer clock and store it into some sort of variable? I'd like to put a bonus in my game program for somebody using it in the wee...
That worked great. Thank you very much, and sorry for blowing a simple question out of proportion.
I thought that might be the problem. I have Bloodshed Dev-C++ Version 4.
Still doesn't work. Does fixed have to be the first thing right after cout? I'll try tinkering around a bit.
Oh wow. Thank you very much. I was putting fixed AFTER setprecision. I guess my book is a little out of date. :D
Actually it didn't work. I get an error that says fixed is undeclared and it says...
This is a very amatuerish question, but no matter what I try, there is no flexibility with setprecision when it comes to me wanting just two places beyond the decimal. When I use setprecision(2) and...
Thanks very much. I looked around but I guess I did a bad job. I was looking for a complete explanation and you supplied me with one. Thanks for the quick response! :)
I have several variables in a program of mine that I would like to be able to save to a file, exit the program, then recall the data at request another time the user runs the program. Basically to...
Thank you so much for the help! I'll look into it. I found another way around it since the enemies in my game would be too generic with the same pattern of behaviors. I will look at the string class...
I'm afraid I've tried that already. I get a compiling error--the array sizes are missing.
int enemyNumber = 1;
char enemy[] = "Dragon";
int enemyHealth = 500;
int enemyMagic = 0;
int enemyAttackMin = 50;
int enemyAttackMax = 60;
char enemySpell[];
int...