![](https://img-blog.csdnimg.cn/20201014180756922.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
!!!C++ General
文章平均质量分 75
b_end_an
这个作者很懒,什么都没留下…
展开
-
!!!Constant Expression (From MSDN)
C++ requires constant expressions — expressions that evaluate to a constant — for declarations of:Array boundsSelectors in case statementsBit-field length specificationEnumeratio转载 2012-09-11 10:52:51 · 433 阅读 · 0 评论 -
!!!VC++ tips
How to show line numberGo to Tools > Options > Text Editor > All LanguagesCheck "Line Number"How to check VC build errorGo to http://msdn.microsoft.com/en-us/library/hhbdtt6dHow to input EO原创 2012-09-08 21:47:51 · 269 阅读 · 0 评论 -
!!!C++ -> C
Create a new variablewe can create a new variable by the type specifier + the initializer: int main(){ cout << string("abcdefd") << endl; //output is abcdefd}int main(){ string a;原创 2012-10-29 04:04:01 · 261 阅读 · 0 评论 -
!!!Abstract class & virtual destructor problems
Abstract ClassAn abstract class contains at least one pure virtual function.You cannot use an abstract class as a parameter type, a function returntype, or the type of an explicit conversion, nor原创 2013-07-23 10:12:08 · 629 阅读 · 0 评论 -
!!!Data Padding
http://en.wikipedia.org/wiki/Data_structure_alignment转载 2013-08-16 06:19:14 · 963 阅读 · 0 评论 -
!!!C++输入输出进制、数据宽度与对齐、精度、取整
1、数的进制默认进制:默认状态下,数据按十进制输入输出。如果要求按八进制或十六进制输入输出,在cin或cout中必须指明相应的数据形式,oct为八进制,hex为十六进制,dec为十进制。举例:int i, j, k, l;coutcin>>oct>>i;//输入为八进制数cin>>hex>>j;//输入为十六进制数cin>>k;//输入仍为十六进制数ci转载 2012-10-09 04:30:51 · 1193 阅读 · 0 评论 -
!!!C++ sample code
1. 类继承继承时,子类中含有父类所有的public & protected & private member. 即使在子类中定义同名成员,也可以通过scope区分:#includeusing namespace std;class A {public: int x;protected: int z;private: int y;};class B: public原创 2012-12-20 09:26:39 · 781 阅读 · 0 评论 -
!!!float/double在内存中的表示
C语言中float,double类型,在内存中的结构(存储方式)从存储结构和算法上来讲,double和float是一样的,不一样的地方仅仅是float是32位的,double是64位的,所以double能存储更高的精度。任何数据在内存中都是以二进制(0或1)顺序存储的,每一个1或0被称为1位,而在x86CPU上一个字节是8位。比如一个16位(2 字节)的short int型变量的值是100原创 2013-05-20 09:20:20 · 1078 阅读 · 0 评论 -
!!!Formal Parameter & Actual Parameter & Pointer (形参, 实参, 指针)
Formal Parameter vs Actual ParameterFormal Parameter: 形参Actual Parameter: 实参The term parameter (sometimes called formal parameter) is often used to refer to the variable as found in the functi原创 2013-08-15 01:58:11 · 1322 阅读 · 0 评论 -
!!!argc and argv as parameter of main function
Definitionhttp://stackoverflow.com/questions/3024197/what-does-int-argc-char-argv-meanargv and argc are how command line arguments are passed tomain() in C and C++.argc will be the number of原创 2013-09-16 23:00:33 · 710 阅读 · 0 评论 -
!!!How to initialize pointer with new objects
class myClass{ protected: yourClass * yc; bool dynamic; public: myClass() { dynamic = true; yc = new yourClass (); } myClass (yourClass * tyc ) {转载 2013-07-23 05:46:59 · 442 阅读 · 0 评论 -
!!!100 C++ Questions (I)
Red: could not solveOrange: have better answer画图绘制余弦曲线my code:#include #include #include using std::cin;using std::cout;using std::endl;using std::vector;int main(){ int a[41]原创 2012-10-05 03:25:14 · 647 阅读 · 0 评论