#pragma warning(disable : 4996)
#include <iostream>
#include <string.h>
//struct
struct student {
char name[50];
int age;
float height;
};
struct student s1 = { " Nina Chase", 12, 1.55 };
struct student s2 = { " Shyann Morris", 12, 1.65 };
//typedef struct
typedef struct {
char name[50];
int age;
float height;
} studentType;
studentType s11 = { " Nina Chase", 12, 1.55 };
studentType s22 = { " Shyann Morris", 12, 1.65 };
//typedef struct
typedef struct studentTypeStart {
char name[50];
int age;
float height;
} studentTypeEnd;
studentTypeEnd s33 = { " Shyann Morris", 12, 1.65 };
struct studentTypeStart s44 = { " struct studentTypeStart Shyann Morris", 12, 1.65 };
studentTypeStart s55 = { " Shyann Morris studentTypeStart", 12, 1.65 };
studentTypeEnd *stuPtr;
// main method
int main()
{
std::cout << "Hello World 2!\n";
std::cout << s11.name << "\n";
std::cout << s33.name << "\n";
std::cout << s55.name << "\n";
std::cout << s44.name << "\n";
}
Jul 20