Ask your own question, for FREE!
Computer Science 22 Online
OpenStudy (christos):

C++ Can you guys help me fix that code? It's supposed to be a calendar, but there seem to be some syntax errors? :/ EDIT: there is the exact error http://screencast.com/t/SFhC7bIRw

OpenStudy (christos):

@timo86m @Hero @zepdrix @robtobey @Mertsj @jim_thompson5910 @modphysnoob

OpenStudy (anonymous):

what's was exact error?

OpenStudy (christos):

undeclared identifiers

OpenStudy (anonymous):

it doesn't say line number

OpenStudy (christos):

what do you mean?

OpenStudy (anonymous):

usually it will say undeclared identifier and something else too

OpenStudy (christos):

...

OpenStudy (christos):

there is the exact error http://screencast.com/t/SFhC7bIRw

OpenStudy (anonymous):

well it says that main must return int, so just try writing int main(){ //all code return 0; }

OpenStudy (christos):

I already did that @Tomas.A but its behavior is not as expected right now

OpenStudy (anonymous):

what's wrong? i have actually compiled code myself and it seems to work fine (except for certain leap years as you probably know yourself)

OpenStudy (anonymous):

did you find this code by googling..? lol

OpenStudy (christos):

Did you compile it? Using which compiler?

OpenStudy (christos):

@Tomas.A

OpenStudy (anonymous):

g++ 4.4.3

OpenStudy (christos):

Can you give me the cpp please

OpenStudy (anonymous):

i just changed void main to int main and at the end of main added return 0

OpenStudy (christos):

please tell me where exactly

OpenStudy (anonymous):

at the end of main function

OpenStudy (christos):

I might as well doing a mistake at the location for all it matters lol

OpenStudy (anonymous):

actually it doesnt really matter its working even without adding return 0 its just a nice practice but if you added it at random place it might break something

OpenStudy (anonymous):

why dont you try to write code yourself?

OpenStudy (christos):

Dud that G++ is on linux? I cant get it to work on Visual studio so many undeclared identifiers with no particular reason

OpenStudy (anonymous):

yes its on linux but you can get it on windows as well also i didn't mention obvious thing that i removed this line "#include "stdafx.h"" also your teacher can easily notice that you copied it from internet (if he cares)

OpenStudy (anonymous):

i can help u in c++ but give the code i'll have to write it all

Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!
Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!