#include <stdio.h> #include <conio.h> struct temp { int a; void get_data() { printf("Enter value of a : "); scanf("%d",&a); } }T; int main() { T.get_data(); }
8:field `get_data' declared as a function
8:[Warning] no semicolon at end of struct or union
examples:
Below code is not valid C code (i.e. valid C11) code but it is valid C++ (i.e. C++14) code.
typedef struct someStruct {
int i;
char c;
someStruct() {
i = 0;
c = 'c';
}
someStruct(char inpChar) {
i = 1;
c = inpChar;
}
} t_someStruct;
No comments:
Post a Comment