// 6. 구조체 - 4 : 함수가 구조체 안에....
#include <stdio.h>
#include <string.h>

struct Sakak {
    int garo;
    int sero;
    char name[10];
    int nubi;
    void Myun(int a, int b, int* c) {
        *c = a*b;
    }
};

/*
void Myun(int a, int b, int* c) {
    *c = a*b;
}
*/

int main() {
    struct Sakak a;
    struct Sakak b;

    a.garo=1; a.sero=2;
    strcpy(a.name,"Nemo1");
    b.garo=3; b.sero=4;
    strcpy(b.name,"Nemo2");

    a.Myun(a.garo,a.sero,&a.nubi);
    b.Myun(b.garo,b.sero,&b.nubi);
   
    printf("%d %d %s %d\n",a.garo,a.sero,a.name,a.nubi);
    printf("%d %d %s %d\n",b.garo,b.sero,b.name,b.nubi);
}

Embed on website

To embed this project on your website, copy the following code and paste it into your website's HTML: