What is the difference between a .h (header file) and a .cpp file?

I am creating a windows: forms application. I read some of the answers to try to understand the concepts of .h (header file) and .cpp (implementation files). When I created the GUI for my application. I noticed that the code fits in the .h file. But when I double-clicked the button control to add code to the procedure, the code was created in the .h file instead of the .cpp file. Am I slicing and putting this code in a .cpp file, or is this the one the links are in? The definition procedure is saved in the .h file and will be associated with the procedure code in the .cpp file.

+3
source share
5 answers

. -, , C ++. , ( ) ++/CLI, . .NET.

, ++ IDE. , , , , "". , . , . . , , , , . , .

++ IDE , 1.1 # VB.NET, . , , . 2.0, # VB.NET . ++/CLI. , ++/CLI . , . inline .

Anyhoo, .cpp, . Cut + paste , . , , . , ++/CLI , .

+3

, , , .., .cpp . , , . , , .

, , . .

; , "" callsite.

+3

( ) ( ). .cpp.

, , , , . .

+1

(*.h) , , cpp . .

, (, ) .

+1

*.cpp . *.h , . , , , .

0
source

Source: https://habr.com/ru/post/1753028/


All Articles