Introduction to object

本文介绍了C++编程中的一些基础概念,包括声明与定义的区别、extern关键字的作用、包含文件的不同方式及其搜索路径、链接过程及使用库的方法、命名空间的使用、main函数的特点以及输入输出流的使用。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

1 Declarations VS definitions     (Page 81)
    declarations: This function or variable exists somewhere, and here is what it should look like.
    definitions: Make this function here or make this variable here, it allocates storage for the name.
For a variable, the compiler determines how big that variable is and causes space to be generated in memory to hold the data for that variable. For a function, the compiler generates code, which ends up occupying storage in memory.
 
2 Extern          (Page 84)
3 Include          (Page 85)
include <>: there's some kind of "include search path" that you specify in your environment or on the compiler command line.
include "": Search for the file relative to the current directory. If the file is not found, then the include directive is reprocessed as if it has angle brackets instead of quotes.
4 Linking         (Page 87)
4.1 Using libraries         (Page 88)
    step1 Include the library's header file.
    step2 Use the functions and variables in the library.
    step3 Link the library into the executable program.
If you are using an add-on library, you must explicitly add the library name to the list of files handed to the linker.
5 Using namespace
    The using directive expose only those names for the current file.
6 main
In C++, main() always has return type of int.
7 iostreams
8 Calling other programs
system();                   //<cstdlib>

转载于:https://www.cnblogs.com/ruccsbingo/p/3680007.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值