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()

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++?

  • 141
  • 1
  • 2
  • 6