+ 6
difference between variable and identifiers
4 ответов
+ 4
variable can change and identifiers are name given to variable
+ 2
variable is a chunk of memory (RAM) that can change
identifier is the name you give to your variable
+ 1
variable is a data storage location so identifier is the name type of variable
0
void main() { ... } is wrong. If you're declaring main this way, stop.(Unless your code is running in a freestanding environment, in which case it could theoretically be correct.)
main() { ... } is acceptable in C89; the return type, which is not specified, defaults to int. However, this is no longer allowed in C99.
Therefore...int main() { ... } is the best way to write main if you don't care about the program arguments. If you care about program arguments, you need to declare the argc and argv parameters too. You should always define main in this way. Omitting the return type offers no advantage in C89 and will break your code in C99.😎