Jump to content
  • Advertisement
Sign in to follow this  
rappen

Functions

This topic is 4090 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi, i've got a problem again. he wouldn't compile and run this:
int optellen(int x, int y)
{
  return x+y;	// retourneer x+y 
}

int main()	// main functie
{
  int x,y;	// 2 variabelen declareren
  
  cout <<"2:";	
  cin >> x;				// voer waarde x in
  cout <<"\n4:";
  cin >> y;				// voer waarde y in
  cout << optellen(x,y);		// spring naar de functie optellen en
					// laat de  retour waarde zien

  return 0;
}

Well...what's the problem with this one :S EDIT: sorry guys, This the error he gives :Cout undeclared. - Rappen. [Edited by - rappen on May 10, 2007 8:19:37 AM]

Share this post


Link to post
Share on other sites
Advertisement
What error does the compiler give you? If that's your full code, you're missing this:

#include <iostream>
using namespace std;

Share this post


Link to post
Share on other sites
Post your errors. You were told this a number of times in your previous thread.

Share this post


Link to post
Share on other sites
Yeah sorry the error he gives is: Cout undeclared.
And i already tried with this above the whole source:


#include <iostream>
using namespace std;



But it didn't work.

- Rappen.

Share this post


Link to post
Share on other sites
Quote:
Original post by rappen
Yeah sorry the error he gives is: Cout undeclared.

If that's the exact error text then the problem is very likely that you've accidentally typed Cout rather than cout somewhere in your program; programming languages (well, many of them, including C++) are case sensitive.

Share this post


Link to post
Share on other sites
please re-post the updated code (in a new post, don't edit the first post of the thread). Also don't give us a summary of the error in your own words, copy-paste the *actual* error.

-me

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!