I have just started with programming and had a question regarding main function , i read somewhere that we declare main function with a int data type and use and integer with the return statement, why can we not declare main function with a string data type and use a string as a return?
string main(){ return "hello";}
why is this code invalid ?
i have tried running this code in codeblocks and got an error error:
'string' does not name a type|
||=== Build failed: 1 error(s), 0 warning(s) (0 minute(s), 0 second(s)) ===|