/
githubmirror
/
CPlusPlusThings
Обзор
Документация
Войти
/
githubmirror
/
CPlusPlusThings
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
basic_content/struct/struct_func.c
30 строк
498 B
zhangxing
support bazel complie this project and format code.
30 мар 2024, 17:00
30 мар 2024, 17:00
3c8a3f2
Код
Авторство
О чём код?
#include <stdio.h> struct Base { // public int v1; // public: //error int v2; // private: int v3; // void print(){ // c中不能在结构体中嵌入函数 // printf("%s\n","hello world"); // }; //error! }; void Base() { printf("%s\n", "I am Base func"); } // struct Base base1; //ok // Base base2; //error int main() { struct Base base; base.v1 = 1; // base.print(); printf("%d\n", base.v1); Base(); return 0; }