Saturday 4 November 2017

c - Is it a definition or a declaration?

Your understanding is correct. Your code example is a
declaration of a type. In 'C' you can declare a type and immediately use it to define a
variable.


So your example is a pure
declaration.


And here is an example of declaration+variable
definition:


struct foo {
char
name[10];
char title[10];
int salary;
}
var;

No comments:

Post a Comment

php - file_get_contents shows unexpected output while reading a file

I want to output an inline jpg image as a base64 encoded string, however when I do this : $contents = file_get_contents($filename); print &q...