Log in

View Full Version : Start function


jackall
October 21st, 2010, 13:15
what is a start function..!
why is it essential..!

could you please tell me why ‘am not able to compile this code , lifted from kaspersky book..!?

Code:
#include <stdio.h>
#include <stdlib.h>
void main()
{
int a;
printf(">OS Version:\t\t\t%d.%d\n\
>Build:\t\t\t%d\n\
>Number of arguments:\t%d\n,"\
_winmajor, _winminor, _osver, __argc);
for (a=0; a < __argc; a++)
printf(">\tArgument %02d:\t\t%s\n", a+1, __argv[a]);
a = !a - 1;
while(_environ[++a]) ;
printf(">Number of environment variables:%d\n", a);
while(a) printf(">\tVariable %d:\t\t%s\n",
a, _environ[--a]);
}


thank you..!

aqrit
October 22nd, 2010, 09:20
A program's entry point is important ... because it is the address of the first instruction to be run by your program.

There are many syntax errors in the code for that console application.

also
Quote:
CRT global variables such as _winmajor, _winminor etc. are declared _CRT_INSECURE_DEPRECATE _CRT_OBSOLETE. The suggected workarounds like _get_winmajor() are *also* declared deprecated.

jackall
October 22nd, 2010, 10:34
Quote:
[Originally Posted by aqrit;87955] There are many syntax errors in the code for that console application.


thank you aqrit..!

it’s very kind of you, to offer this prompt response..!

regards..!