main
Peace 6 days ago
parent 793beddc19
commit d6b2615c7e
  1. 13
      .vscode/tasks.json
  2. 15
      practice/lc_functionArgsByReference.c
  3. 30
      practice/lc_structures.c

13
.vscode/tasks.json vendored

@ -70,13 +70,22 @@
"type": "cppbuild", "type": "cppbuild",
"label": "C/C++: gcc.exe 활성 파일 빌드", "label": "C/C++: gcc.exe 활성 파일 빌드",
"command": "C:/mingw64/bin/gcc.exe", "command": "C:/mingw64/bin/gcc.exe",
// main ()
"args": [ "args": [
"-fdiagnostics-color=always", "-fdiagnostics-color=always",
"-g", "-g",
"${fileDirname}\\*.c", "${file}",
"-o", "-o",
"${fileDirname}\\bin\\${fileBasenameNoExtension}.exe" "${fileDirname}\\bin\\${fileBasenameNoExtension}.exe",
], ],
// // main
// "args": [
// "-fdiagnostics-color=always",
// "-g",
// "${fileDirname}\\*.c",
// "-o",
// "${fileDirname}\\bin\\${fileBasenameNoExtension}.exe"
// ],
"options": { "options": {
"cwd": "C:/mingw64/bin" "cwd": "C:/mingw64/bin"
}, },

@ -0,0 +1,15 @@
#include <stdio.h>
void addone(int n)
{
n++;
}
int main()
{
int n = 0;
printf("Step0: %d\n", n);
addone(n);
printf("Step2: %d\n", n);
}

@ -0,0 +1,30 @@
#include <stdio.h>
struct Point
{
int x;
int y;
};
typedef struct
{
char* brand; // 동적 할당을 위한 처리
int model;
} Vehicle;
int main()
{
struct Point pt;
pt.x = 10;
pt.y = 5;
Vehicle vc;
vc.brand = "Ford";
vc.model = 2025;
printf("pt.x: %d\n", pt.x);
printf("pt.y: %d\n", pt.y);
printf("\n");
printf("vc.brand: %s\n", vc.brand);
printf("vc.model: %d\n", vc.model);
}
Loading…
Cancel
Save