#what is special about main() and how is it different from other functions (im new to cpp)

10 messages · Page 1 of 1 (latest)

waxen snow
#

ive seen people put a lot of emphasis on the main function in cpp, however i cant tell how its different from other functions. im also not sure if functions in cpp have to be called like python so id like some clarity on that pls

torn juniper
# waxen snow ive seen people put a lot of emphasis on the main function in cpp, however i can...

الدالة main() هي النقطة البداية لبرامج C++ وتُستدعى أولاً. يمكنها إرجاع قيمة للتحكم في نجاح أو فشل البرنامج، ويمكنها أيضًا استقبال معاملات من خط الأوامر. تختلف في صيغتها عن الدوال الأخرى وتستخدم للتحكم في تنفيذ البرنامج والتفاعل مع البيئة الخارجية.

real pawn
#

the starting point for any cpp program is always function with following signature:

int main();

or, alternatively if you want to take in command line arguments

int main(int argc, char** argv);
latent mauve
void robin
#

char* is an address that points to multiple char

#

the number of char* is provided in argc

#

the number of char in a char* can be fetched by reading for the /0 (null terminator character)

#

look up “pointer arrays” on google

real pawn