What is integer value in c++ | Sololearn: Learn to code for FREE!


What is integer value in c++

Int main() has int meaning integer, does this integer means only numbers?

8/4/2021 5:19:43 AM

Sanjana Sinha

15 Answers

New Answer


https://code.sololearn.com/cE6q0u76Qx8n/?ref=app Linux stores the return code in an environment variable $?. Different codes mean different error types, and code 0 usually means no errors. But hey, you re the programmer and you could instead decide to return today's weather forecast.


NotHuman we are talking about C++ (standard) not ++C language of course at the end of day only binary code matters ..


User_dead ; this is a super basic c++ hello world code and im afraid that i might make it more complicated if i try explain it. I recommend you simply start to take the c++ course.


"int main()" means that function needs to return some integer at the end of the execution and we do so by returning 0 at the end of the program.


Sanjana Sinha means that program executed successfully.


ChillPill 🙃😌


Returning to zero means?


Sanjana Sinha return is a predefined keyword if u you about function than u can understood much better if you making any function rather than void it will return any values for example int calculate () this calculate will return int value u need to use return statement or u u writing like this float calculate () { Return statement } But in case of void calculate () { No return } If u writting anything apart from void you need to return any value it can be int float char ..... anything. In c language generally we using void main () as a main function but its removed in c98 as long year ago .And cpp is more strict than C so if u will use void main() as a main function in cpp it will give you warnings and error. when you using int main its necessary to use return keyword so we writting return 0 which denotes your program is successfully executed return 1 for failure. If u dont like to write return 0 then you can write like this return EXIT_SUCCESS ; same in case of failure return EXIT_FAILURE;


ChillPill sir can you pls tell about this. string code{ R"( #include <iostream> int main(){ std::cout << "helloworld" << std::endl; return 42; } )" }; How its working becz i never studied this


Возвращает - байты :)


Martin Taylor (IYANR) C++ is language and its compilers are just some collection of files that can be modified. In addition to return type you can even rename main() function to nima() for example. If you want more you can give a new name to it like The ++C Language. If you have a country under your control universities will teach it instead of standart C++. Anyway text files are under our control even though we may not control countries. But in general you are right


yes it means that method can return only integer numbers. if you don't like you can change it to void, pointer .. it is free and under your control