Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old May 17th, 2006, 11:42 PM   #11
ReggaetonKing
Sexy Programmer
 
ReggaetonKing's Avatar
 
Join Date: Nov 2005
Location: New Jersey
Posts: 891
Rep Power: 4 ReggaetonKing is on a distinguished road
Send a message via AIM to ReggaetonKing
A novice programmer should in no way try to change the language that one is programming in. It will cause confusion and unjust practices.
__________________
I would love to change the world, but they won't give me the source code!
ReggaetonKing is offline   Reply With Quote
Old May 18th, 2006, 12:39 AM   #12
msk420
Programmer
 
msk420's Avatar
 
Join Date: May 2006
Posts: 85
Rep Power: 3 msk420 is on a distinguished road
I agree you should get used to using the code and not rely on the compiler. Some compilers require you to use more code for example in some programs that you write in Dev-C++ in some programs you need to include things like cin.get() and system ("PAUSE") they might be needed for some programs to work... They are just a few problems that I have come accrost (I dont know if I spelled that right lol) in my programming with Dev-C++
__________________
Code Forums
msk420 is offline   Reply With Quote
Old May 18th, 2006, 5:45 AM   #13
grumpy
Programming Guru
 
grumpy's Avatar
 
Join Date: Jun 2005
Location: Adelaide, South Australia
Posts: 1,260
Rep Power: 5 grumpy will become famous soon enough
As a matter of fact, both the 1999 C standard and the C++ standard specify that falling off the end of main() [i.e. reaching the curly brace] is the same as returning zero. The ARM specified the same thing, so all C++ compilers (whether they predate the ISO C++ standard or not) should handle falling off the end of main() correctly. I'm not sure offhand, but suspect the 1989 C standard specifies the same thing.

There was definitely an issue with pre-standard C compilers: the behaviour on falling of the end of main() was unpredictable. So, if you have a C compiler that predates the 1989 C standard .....

Coming back to the original problem, proudnerd, linker errors usually mean that you haven't specified enough libraries on the command line. Or it might mean that some environment variables (which specify what directories the linker should look in for library files) ar not set correctly.
grumpy is offline   Reply With Quote
Old May 18th, 2006, 6:30 PM   #14
proudnerd
Newbie
 
Join Date: May 2006
Posts: 21
Rep Power: 0 proudnerd is on a distinguished road
I'm sorry to bother you with my newbie-ness, but here's another code problem for you guys to help me with (and this time I'll include the errors ).

#include <iostream>
using namespace std;
int main()
{
	int favNumber;
	cout << "What's your favorite number? ";
	cin >> favNumber;
	if (favNumber == 13);
	{
		cout << "Hey, that's my favorite number, too!\n";
	}
	else;
	{
		cout << "That's not my favorite number, but oh well.\n";
	}
	return 0;
}

I get these two errors:

error: expected primary-expression before "else"
error: expected `;' before "else"
proudnerd is offline   Reply With Quote
Old May 18th, 2006, 6:44 PM   #15
titaniumdecoy
Expert Programmer
 
titaniumdecoy's Avatar
 
Join Date: Nov 2005
Posts: 931
Rep Power: 4 titaniumdecoy is on a distinguished road
Send a message via AIM to titaniumdecoy
Try removing the ; after else.
titaniumdecoy is online now   Reply With Quote
Old May 18th, 2006, 7:15 PM   #16
Jimbo
Battle Programmer
 
Jimbo's Avatar
 
Join Date: Feb 2006
Location: Bellevue, WA, USA
Posts: 770
Rep Power: 3 Jimbo is on a distinguished road
also the one after if(favNumber == 13)
Jimbo is offline   Reply With Quote
Old May 18th, 2006, 7:48 PM   #17
proudnerd
Newbie
 
Join Date: May 2006
Posts: 21
Rep Power: 0 proudnerd is on a distinguished road
Thank you so much. It works perfectly now!
proudnerd is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 3:37 AM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC