student.c
来自「开放源码的编译器open watcom 1.6.0版的源代码」· C语言 代码 · 共 69 行
C
69 行
/*
* This file was generated by the SOM Compiler and Emitter Framework.
* Generated using template emitter:
* SOM Emitter emitctm: 2.23.1.9
*/
#ifndef SOM_Module_student_Source
#define SOM_Module_student_Source
#endif
#define Student_Class_Source
#include "student.ih"
#include <stdio.h>
#include <string.h>
/*
* sets up a new student
*/
SOM_Scope void SOMLINK setUpStudent(Student *somSelf, char *id,
char *name)
{
StudentData *somThis = StudentGetData(somSelf);
StudentMethodDebug("Student","setUpStudent");
strcpy(_id, id);
strcpy(_name, name);
}
/*
* prints the student information
*/
SOM_Scope void SOMLINK printStudentInfo(Student *somSelf)
{
StudentData *somThis = StudentGetData(somSelf);
StudentMethodDebug("Student","printStudentInfo");
printf(" Id : %s\n", _id);
printf(" Name : %s\n", _name);
printf(" Type : %s\n", _getStudentType(somSelf));
}
/*
* returns the student type
*/
SOM_Scope char* SOMLINK getStudentType(Student *somSelf)
{
static char *type = "student";
StudentData *somThis = StudentGetData(somSelf);
StudentMethodDebug("Student","getStudentType");
return type;
}
/*
* returns the student ID
*/
SOM_Scope char* SOMLINK getStudentId(Student *somSelf)
{
StudentData *somThis = StudentGetData(somSelf);
StudentMethodDebug("Student","getStudentId");
return _id;
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?