Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Dark GDK / simple c++ problem

Author
Message
That1Smart Guy
15
Years of Service
User Offline
Joined: 26th Feb 2009
Location: Somewhere...... yep
Posted: 25th Jun 2009 06:04
keeping in mind that I have been using c++ for all of a week, can anyone explain to me why I get 21 errors when I try to build this?



There are only 10 kinds of people in the world, those who understand binary and those who dont
That1Smart Guy
15
Years of Service
User Offline
Joined: 26th Feb 2009
Location: Somewhere...... yep
Posted: 25th Jun 2009 06:10 Edited at: 25th Jun 2009 06:32
ok I think I figured ONE problem out, in my class constructor I called it a void return type, removing the word void from the prototype and the function dropped it down to 19 errors (at least we're making progress)

edit:

ok there are also 6 errors in each of the "Truck can carry" cout lines, but I cant find then, I just see the error reduction when I comment those lines

edit 2:

also 2 errors in the Vehicles.set_data line and 4 more in the Vehicles Truck() line

it seems the common factor here is the truck class object, did I do something wrong when I initialized it?

There are only 10 kinds of people in the world, those who understand binary and those who dont
That1Smart Guy
15
Years of Service
User Offline
Joined: 26th Feb 2009
Location: Somewhere...... yep
Posted: 25th Jun 2009 06:35
figures, I forgot to semicolon my object initiation so that was the source of all the errors

sorry for waste of thread, I tried to find the problem for an hour before I made this and was about to give up so I posted this thread then.... well you can read the rest in my above post

There are only 10 kinds of people in the world, those who understand binary and those who dont
AndrewT
17
Years of Service
User Offline
Joined: 11th Feb 2007
Location: MI, USA
Posted: 25th Jun 2009 06:37 Edited at: 25th Jun 2009 06:38
Hmmmm...I suppose it would help if you told is what the errors were.

However I did notice that you're not ending these two lines with semi-colons when you should be:



Here's the fixed code, it compiles fine for me:



EDIT:

I wasn't fast enough.

i like orange
That1Smart Guy
15
Years of Service
User Offline
Joined: 26th Feb 2009
Location: Somewhere...... yep
Posted: 25th Jun 2009 07:13
and what do you mean what the errors were, it tells you?

i was just readin the end report after i hit f7 (build)

and yeah, wen I first heard that the #1 error in c++ was forgetting semicolons, i thought it was a joke, it sounded so obvious that i didnt think it was possible to forget one, guess I was wrong, rofl

There are only 10 kinds of people in the world, those who understand binary and those who dont

Login to post a reply

Server time is: 2024-10-01 05:58:58
Your offset time is: 2024-10-01 05:58:58