【C语言】C语言面向对象的接口封装实现
2023-09-14 09:05:33 时间
目录
Operator.h
//
// Created by cjs0719 on 2022/6/24.
//
#ifndef UNTITLED1_OPERATOR_H
#define UNTITLED1_OPERATOR_H
typedef struct {
int age;
int num;
}Stu;
typedef struct {
void *handle;
Stu stu;
int (*Add)(struct S_FAN_STU_OP *stu_op,int a,int b);
}S_FAN_STU_OP;
extern S_FAN_STU_OP* Initialize(void);
#endif //UNTITLED1_OPERATOR_H
Operator.c
//
// Created by cjs0719 on 2022/6/24.
//
#include "Operator.h"
#include <stdlib.h>
static int add_num(S_FAN_STU_OP *stu_op,int a,int b);
static int add_num(