1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44
| #include <iostream> #include <vector> #include <stdlib.h> #include <stdlib.h> #include <string.h>
namespace m_nsp { struct _SubData { int a; int b; };
using SubData = _SubData;
typedef struct _MainData { SubData s; } MainData; }
using MainData_ = m_nsp::MainData;
int main(int argc, char *argv[]) { std::cout << "Hello, world!\n";
MainData_ a;
FILE *fp = fopen("version", "r"); if (!fp) { return -1; } char buff[8] = {'\0'}; int version; fread(buff, sizeof(buff), 1, fp); char *ch = strchr(buff, '.'); *ch = '\0'; printf("%d %d\n", atoi(buff), atoi(ch + 1));
return 0; }
|