4 of 5
fixed grammar, corrected spelling, improved formatting

function works fine without return value in c++

I forgot to write return 'a'; in show function and return 0; in main function but it works fine in Code::Blocks.

#include <iostream>

using namespace std;

char show()
{    
  cout<<"this is show function"<<endl;
}

int main()
{
  show();
}

I am using Code::Blocks 10.05 in Ubuntu 12.04. Why does this code work fine in Code::Blocks but not in Turbo C++?

twister_void
  • 141
  • 1
  • 2
  • 6