News:

Accounts with zero posts and zero activity during the last months will be deleted periodically to fight SPAM!

Main Menu

how come the code::blocks doesn't return any value, i can't identify what's wron

Started by yangfizz, September 23, 2012, 05:11:37 PM

Previous topic - Next topic

yangfizz


#include <iostream>

using namespace std;

int function(int x);


int main()
{
    int x;
    function(x);
    return 0;
}

int function(int x)
{
    cin>>x;
    return x
}


after i input the value, i was supposed to get the value because of return, but for some reason, it doesn't return anything at all.

Ceniza

Code::Blocks is NOT a compiler, and we are NOT a general programming forum. Did you read the rules when you registered?