Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #define _CRT_SECURE_NO_WARNINGS
- #include <iostream>
- #include <conio.h>
- #include <stdio.h>
- #include <string.h>
- #include <iostream>
- class student
- {
- char name[10];
- char f_name[30];
- long number;
- public:
- void set_name(char *p);
- void set_f_name(char *q);
- void set_number(long n);
- void print(void);
- };
- void student::set_name(char *p)
- {
- strcpy_s(name, p);
- // p = name;
- }
- void student::set_f_name(char *q)
- {
- strcpy(f_name, q);
- // q = f_name;
- }
- void student::set_number(long n)
- {
- number = n;
- }
- void student::print(void)
- {
- // std::cout << name << std::endl;
- // std::cout << f_name << std::endl;
- // std::cout << number << std::endl; <-konczy linie
- printf("%s\n", name);
- printf("%s\n", f_name);
- printf("%d\n\n", number);
- }
- void main(void){
- student a;
- a.set_name("Krystian");
- a.set_f_name("Lenc");
- a.set_number(223561);
- a.print();
- //student b;
- //b = a;
- // b.print();
- _getch();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement