[TIB] Re: [OT] C++ help


[Prev][Next][Index][Thread]

[TIB] Re: [OT] C++ help




Again, the class I took was really a C class with a C++ twist, but I
think it is close enough.  I'm assuming it is a command line program...

scanf("%d %d %d", &year, &day, &month);

I can't remember if the spaces are supposed to be in between the %d's or
not.  Try it both ways.

Or 3 separate ones would work just as well:

scanf("%d", &year);
scanf("%d", &day);
scanf("%d", &month);

Even though they are separate, if the user inputs them together
separated by spaces, it will work just fine.

BTW, why am I doing your homework?  :)



> hey i have to make a program that tells the day of the week of a
certain
> date...for example 1983 23 7, was a friday...what i need to know is
how
> to i get the 1982, 23, 7 seperate...the user will enter it like this
> "1983 23 7" and i need to get 1983 alone, and 23 alone and 7 alone
> 
> thanks,
> chris







References: