This topic is now archived and is closed to further replies.

Function Problem

This topic is 5308 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

Ok, I've been having troubles with functions while learning C++ so I am trying out my own little simple function that adds two numbers. Simple right? I get everything to compile but I get some wierd ass output that when I add 5 and 5 it gives me this as output: 004013E3. I don't get it. Here's my source: #include <iostream> int Sum(int x, int x); int main() { using std::cout; using std::cin; int x; int y; int z; cout << "Enter two numbers to add. First: "; cin >> x; cout << "\nSecond: "; cin >> y; z = Sum(x,y); cout << Sum; return 0; } int Sum(int x, int y) { return x + y; } There's no town drunk here, we all take turns. [edited by - Ekim_Gram on June 3, 2003 10:49:11 PM]

Share this post

Link to post
Share on other sites