It is unsafe. In order to use gets() safely, you need to know how many characters you will be reading to ensure your character buffer is large enough:
char buffer[10];
while (gets (buffer) != 0) { ...process buffer... }
The above code has undefined behaviour when the number of characters read is 10 or more (you need one character for the null-terminator). This is because the character buffer, str, decays to a pointer (referencing &str[0]) and the function, gets(), cannot determine the number of characters in a buffer by its pointer alone.
The gets() function was dropped from the C standard in 2011, however some implementations still include it. To avoid the warning, use the fgets() function instead. This allows you to specify the length of your buffer and (when used correctly) prevents buffer overflow.
char buffer[10];
while (fgets (buffer, 10, stdin) != 0) { ...process buffer... }
A main function must be present in every C program.
The main function. Every program must have a main function and it must be declared static.
Nothing special. Of course before you start, you should know how to compile, link, run and debug your programs, but this goes for every platform.
Every C plus plus program that is a main program must have the function 'main'.
Every C program must have a function, named main(), which is where the program starts execution. If there is no function main(), the computer does not know where to start running the program. The function main() must also do something; if it is just empty, some smarter compilers will note that there is nothing for the program to do, and will give this sort of error message to indicate that you forgot to tell the program what to do.
Every C program has a main() function.
A main function must be present in every C program.
The main function. Every program must have a main function and it must be declared static.
Nothing special. Of course before you start, you should know how to compile, link, run and debug your programs, but this goes for every platform.
1..Every program start with main(). 2. Compiler firstly compile line main(). 3. At least one fuction in C language. 4. Syntax of function returntype functionname(parameter/arguments) { body } int main(void) { printf("Hello"); } Sachin bhardwaj skbmca@gmail.com 9868547722
Every C plus plus program that is a main program must have the function 'main'.
Every C program must have a function, named main(), which is where the program starts execution. If there is no function main(), the computer does not know where to start running the program. The function main() must also do something; if it is just empty, some smarter compilers will note that there is nothing for the program to do, and will give this sort of error message to indicate that you forgot to tell the program what to do.
I don't think its possible. Every C++ program must at least have the main function.
The "main" function name is reserved and specifies the entry point of the application.
* Interpreters are useful for program development when execution speed is not important. As the interpreter is in command of the execution process debugging features can be build in. * Debugging is easier since the interpreter stops when it encounters an error. If an error is deducted there is no need to re translate the whole program, * There is no lengthy "compile time", i.e. you do not have to wait between writing a program and running it, for it to compile. As soon as you have written a program, you can run it. * Interpreters normally translate and execute programs line by line, converting each program statement into a sequence of machine code instructions and executing these instructions without retaining the translated version. i.e. In a program with a loop, that the same statement will be translated every time it is encounted. Therefore Interpreter programs are usually slower in execution than compiled programs. * No object code is produced, so a translation has to be done every time the program is running. Source code is required for the program to be executed
The best tip to avoid compile time issues is to follow the coding guidelines and syntactical rules specified in the language. Every programming language has such guidelines mentioned while creating the language. If we follow them, then we will not get compile time errors.
Not every relation is a function. But every function is a relation. Function is just a part of relation.