Can we use char main, string main instead of int main and void main?? If so what is the return type? | Sololearn: Learn to code for FREE!
Neuer Kurs! Jeder Programmierer sollte generative KI lernen!
Kostenlose Lektion ausprobieren
+ 9

Can we use char main, string main instead of int main and void main?? If so what is the return type?

26th Jun 2017, 11:02 PM
Harini T
Harini T - avatar
7 Antworten
+ 6
i mean return value?
27th Jun 2017, 6:27 AM
Harini T
Harini T - avatar
+ 6
Either you return something as int type or return void. No char, no string, nothing else.
27th Jun 2017, 7:13 AM
Sachin Artani
Sachin Artani - avatar
+ 6
most commonly used are int and void if we use char ,string the return values should be specific and it might create errors as well... but u can create some functions names for your purposes
26th Jul 2017, 2:15 PM
Manoj Prasanna
+ 2
The return value can be anything as long as its the same type as the return type.
27th Jun 2017, 4:07 PM
Rrestoring faith
Rrestoring faith - avatar
0
No you cant use char or string. You said the return type in the question. 😜 Ex/ char main() char IS the return type. int main. int is the return type. void main. void is the return type. etc..
27th Jun 2017, 3:57 AM
Rrestoring faith
Rrestoring faith - avatar
0
you might use it as a function and it will return char as if you use it like char main()
28th Jun 2017, 8:45 AM
filimon
0
Idk
10th Jul 2017, 7:14 PM
Elliott Ballentine
Elliott Ballentine - avatar