+ 1

C++ main function

Does C++ support more data types on main function? (Like strings, doubles and int32_t)

17th Dec 2023, 7:06 AM
Mohammad Hossein Kasirloo
Mohammad Hossein Kasirloo - avatar
2 odpowiedzi
+ 5
what you put inside main is what is important. no need to change main's return type. It is just the entry point.
17th Dec 2023, 9:58 AM
Bob_Li
Bob_Li - avatar
+ 4
If you want to work with data types like strings, doubles, and int32_t within your program, you can use these data types inside the function body. However, when dealing with command-line arguments, they are initially passed as strings, and you may need to convert them to the desired types based on your program's logic
18th Dec 2023, 10:40 AM
Ayush Singh
Ayush Singh - avatar