There are lots of ways to do this.
if( number > 999 & number < 10000 )
... do four digit stuff
if( number > 9999 && number < 10000 )
... do five digit stuffYou could always just read it...
Type: Posts; User: quzah
There are lots of ways to do this.
if( number > 999 & number < 10000 )
... do four digit stuff
if( number > 9999 && number < 10000 )
... do five digit stuffYou could always just read it...
Shuffle the desk. Use a counter to keep track of where the "top" of the deck is. Start it at 0. Deal one card by assigning deck[ counter ] to whomever is getting that card. Then increment counter....
z = x * y;
Quzah.
How about you write a small test program to find out? One that actually fully compiles and runs.
Quzah.
Then read the bitwise operator FAQ.
Quzah.
First of all, when you use "first of all", there needs to be a second or next thing. Next, this has nothing to do with it being a varadic function, and everything to do with the format specifier he's...
"1200" isn't an integer. It's a string literal. Lose the quotes if you want the number 1200, and just put 1200.
Quzah.
Why don't you just learn assembly if you want to know what it's really doing?
Quzah.
Make a program that reads entries from a file one at a time until it reaches the end. Once you can do that, make a program read entries one at a time, and then it copies the one it has just read into...
You could say "programming in C".
Quzah.
It doesn't add it, you do when you hit enter. It simply leaves it there.
Quzah.
for (long i=0; i<5e8; i++);
Quzah.
Go read my post again. I didn't ask what RoomNumbers was. I asked what RoomNumber was.
Quzah.
What is 'RoomNumber'? You have 'RoomNumbers, but I don't see 'RoomNumber':
Room_x[RoomNumber] = 'X';If you switch that out to be i, at that point you will be out of range of what your array is...
Even if he did take back his solution as if he didn't actually write it, we're back to square one. He needs to post his new attempt. He's still telling everyone to give him the answer. If we ignore...
fgets + sscanf
FAQ > How do I get a number from the user (C) - Cprogramming.com
FAQ > Get a line of text from the user/keyboard (C) - Cprogramming.com
Quzah.
Is there any reason you just dumped a bunch of code here (tagged wrong) with no question or other text of any kind?
Quzah.
Have you learned about structures yet?
Quzah.
#include<stdhomework.h>That's pretty much all you need for this. Isn't C great?
Quzah.
I'm going to assume this is C++. Otherwise, someone in this thread loves function pointers.
Quzah.
That's because you're storing it all in the same place. If you want the next call to go somewhere else, put it somewhere else. Switching to fread isn't going to change that.
Quzah.
So you don't actually want to learn anything, you just want someone to do it for you? Ok, cya.
Quzah.
Read: FAQ > Get a line of text from the user/keyboard (C) - Cprogramming.com
Quzah.
FILE *ofp = fopen("roster.txt", "w");That is going to start with a new file every time (in effect) because it truncates the file when you open it to w mode.
fprintf(ofp, "%s\n",...
C99 allows for variable length arrays: https://en.wikipedia.org/wiki/Variable-length_array
Quzah.