Learn VC ++ (1)

xiaoxiao2021-03-06  100

I have always wanted to learn VC , I saw a part, but it was more vague. When I was preparing to give up, I found out school, so. . . Hey! Other systems open, VC courses, listen to it. Hey!

Fortunately, they got a lesson when they went today, and the first program is a preamble and some VC background history, so I don't have to listen. When I went today, I started the second chapter. However, the second chapter is something about the foundation of VC , so I still have benefited a lot, listen to class today, start writing some of the books. , Convenient for me. Today is the first: class and its simple use

#include

?

Class Student

{

? int Age;

? char * points;

?

PUBLIC:

? Void setage (int a) / / Internal definition function in the class, pay attention to each other with tellage ()

? {

?? age = a;

?

? Void Tellage (Char * point);

Void Student :: Tellage (CHAR * POINT) ?? // At the class's external definition function, pay attention to the setage () function distinguishes each other {? printf (Point, AGE);

Void main () {? student * p = new student; ?? // Pointer to the pointer to the class, you must first physicalize, then define the pointer new student ,???????? //, the pointer variable must point Can I use after entity variables? (* P) ​​.SETAGE (58); p-> Tellage ("Just Test.age =% D / N"); ?? // Different Item Form of Pointer}

转载请注明原文地址:https://www.9cbs.com/read-123576.html

New Post(0)