C ++ study notes (1) - Impression

zhaozj2021-02-16  47

C study notes (1) - Impression

Chen Genfa

I heard that VB will fade out of the rivers and lakes. As a VB's fans naturally avoided anxious, in order to honor their parents tomorrow. :) Decided to reluctantly cut love, learn C .

A few days of C contact, preliminary impression. C is actually C twin brothers. From the example below, it can be clearly reflected.

#include // The header file is not changed again.

Int Add (int A, int b); // C language seems to not be in a function

int main ()

{

INT X, Y, SUM;

Cout << "Enter Two Numbers:" << '/ n'; // Output is no longer the Printf of the old earth

CIN >> X; / / output also varies,

CIN >> Y; // Input and output use new I / O stream, far-reaching benefits do not say, easy to enter more

SUM = Add (x, y);

COUT << "The Sum IS:" << Sum << '/ n';

}

Int Add (Int A, INT B)

{

INT C;

C = a b;

Return C;

}

Oh, it is the difference between the front annotation! The legendary C has nothing. I have thought that I have C's foundation. This C is naturally not here.

My buddies don't know when he has already appeared in my eyes, he is a bit jealous of my proud. A few words of the mouth, "I heard that C is the most important feature is the object", facing the object? ? ? ? I didn't agree, my brain is faintly hot, in order to save the face, only to continue to struggle with the book.

After an afternoon, I finally had a preliminary understanding of the face.

Facing object = object attribute state

So what is the object? Object is the basic unit we know the world, it is an entity. Its basic characteristics are:

(1) There must be a name to distinguish other objects;

(2) Use properties to describe the characteristics of the object;

(3) Has a set of operations, each operation determines a behavior

"What is the class?" The soul of the buddy is not disconnected behind me. I have enough preparation. Now that this problem is already small case, "class! Is not just". I said that I said that I said:

The class is an abstraction of the object with a common attribute characteristic and method, and the representation of the computer is generally referred to as the same data storage structure. The relationship between it and the object is the specific and abstract relationship. Object is an example of a class.

The buddies are a bit unclear that our group of machinery people, all day and iron, encounter these problems, and it is inevitable. I will give an example of explanation!

For example, "I" is an object. Can tell me this:

Object Name: Chen Genfa

Object properties:

Education: abandoned academic qualifications

Age: 19

Professional: Tie iron

Love history: I forgot by PPMM

Operation of objects:

Dancing on the highway

Write some code comfort yourself

Oh ~, people like me have become a class. In fact, the description in C is simple, as follows: Class Chen Rongfa {

Private:

Char Love History // This I have to let others know, so private:

PUBLIC:

Char degree;

INT age;

CHAR professional;

A () // Function without parameters, used to define the behavior of the object

......

}

I finally got a lot of breath, the concept of classes and objects, I should be able to open a good head for future learning.

My buddies don't know when I stand on me, I will take him, I read the book!

------------------------------------

Struggle for a 100% programmer!

Personal g Personal Description: The son of the farmer, or the farmer! I have lived in mediocrity before the age of 200. I don't want to be legendary after the age of 200.

Poor is the main song, inferior coat, cave, not sold cool, but reality. One year of rice <= 365 * 2.1.5 yuan a meal accounts for 80%. 2.5 yuan a meal accounted for 19.9%, even the meal occasionally (more than 6 yuan), is a classmate party, or when living subsidies are issued!

Smoking, bag smoke when depressed! (City people have not seen it), 3.5 yuan a pound, when the smoke is hidden, the room is surprising, take into account the brothers of the people, do not dare to smoke.

Occasionally, don't ask for your drill, just seek! Every drink, brothers pay for money!

Hello write, or code, or mood text, or oil poems, impromptu book, never collect (code exception).

Since the smaller county, the ear is ok, and it is infected. The brothers have difficult, always a horse, plus the country children to work hard, so few will lose.

Self-recognition, 50 yuan for the first time, for my university; 200 yuan to visit Xiamen, for livelihoods; 20 km, in order to save 2 yuan bus.

The main activities of entertainment are Internet, do not like to play games, do not like to play MM, often post. Netizens are very small, they are invited.

I like three sentences, I have given:

1. God will not live up to anyone, how much you pay, you will get! (Self-comfort)

--- Herry

2. The first, love second (self-encourage)

----- A Dang

3. As long as the process is correct, the ending will be good (self-warning)

---- Chen Zhong

 2003-12-20

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

New Post(0)