- 博客(37)
- 收藏
- 关注
转载 A story of declaration and defintion (C++)
"""To support separate compilation, c++ distinguishes between declarations and definitions. A declaration makes a name known to the program. A file that wants to use a name defined elsewhere include
2015-01-17 21:32:23
577
原创 Another(1@): Back to the home town
Recently, I was busy for the journel.The first thing is to carry the things back to home..The big changes happens in my hometwon right now.(O_O)...
2014-02-18 14:11:13
509
原创 A Important Note
"""ADVICE: USE CONSTRUCTOR INITIALIZERS-------------------------------------------------------------------------------------------------------------------------------------------------------------
2014-01-24 11:08:00
621
转载 Name lookup for Class Member Declarations
It's quoted from the >"""....typedef double Money;string bal;class Account {public: Money balance() { return bal; }private: Money bal;//.....};When the compiler sees the decl
2014-01-22 15:59:07
634
转载 Constructors__<<C++ primer>>
"""Classes control object initialization by defining one or more special member functions known as contstructors. The job of a constructor is to initialize the data members of a class object. A cons
2014-01-17 14:39:23
563
原创 The first class after reading the section7.1 <<C++ primer>>
Today, I start learning the class in C++.. It's really hard to get it.So slow my step into it...I decided to make some records at first.The books mention a simple class on Page 73:struct Sales_da
2014-01-09 21:16:00
753
原创 Pointer to the function
Pointer to the function?It appears on the page.247. I had never get in touch with this concept before. Let me make some records.A function pointer is just that -- a pointer that denotes a function
2014-01-09 12:28:46
512
原创 Today is boring... I register a new account in stackoverflow
Remark it ~Today, i register a new account in stackoverflow.The csdn is nice as the stackoverflow.That's enought for me, a beginner in program
2014-01-09 09:30:17
546
转载 overloaded Function in c++
The overloaded function is an important concept in C++.What's the definition?Function that have the same name but different parameter lists and that appear in the same scope are overloaded. Genera
2014-01-08 14:35:38
1121
转载 Automatic Objects and Local static Objects
Automatic ObjectsThe objects that correspond to ordinary local variables are created when the function's control path passes through the variable's defintion. They are destroyed when control passes
2014-01-06 11:08:39
707
转载 Parameters, Arguments
Quoted from the >:Arguments are the initializers for a function's parameters. The first argument initializes the first parameter, the second argument initializes the second parameter, and so on. Alt
2014-01-06 10:13:42
502
原创 the first glance at the try block
C++ primer introduce some functions of try block.. But it haven't a instance..So I get the first example.#include #include #include using namespace std;int main(){ float num1, num2, resu
2014-01-05 17:08:43
507
原创 C++ primer practice: 5.4.1 (Exercises section) answer
The is an answer (not the only one) for exercise 5.4.1:Remark it for my own path for program path#include #include using namespace std;int main(){ vector sVect; vector iVec; unsigned i
2014-01-03 10:36:28
933
原创 A puzzle for me (cookie)
Today, i met a problem.. I'm a new man in C++ programer.So it's reserved for me... I believe I would get it.#include using nameapce std;int main(){string str;auto sp = str.begin(); /// st
2014-01-02 16:28:37
569
转载 Quoted from Microsoft Website: reinterpret_cast Operator
reinterpret_cast:Allows any pointer to be converted into any other pointer type. Also allows any integral type to be converted into any pointer type and vice versa.form: reinterpret_cast ( ex
2013-12-31 14:24:45
498
转载 summary: sizeof
The result of applying sizeof depends in part on the type involved:*) sizeof char or an expression of type char is guaranteed to be 1.*) sizeof a reference type returns the size of an object of th
2013-12-30 21:23:06
502
转载 lvalue and rvalue
Every C++ expression is either an lvalue or an rvalue. An lvalue refers to an object that persists beyond a single expression. You can think of an lvalue as an object that has a name. All variables, i
2013-12-30 15:01:00
972
转载 Using a Range for with Multdimensional Arrays.
size_t cnt = 0;for (auto &row: ia) for (auto &col : row) { col = cnt; ++cnt;}In the previous example ,we used frefernces as our loop control variables because we wanted to change
2013-12-28 20:42:05
532
转载 tips for subscript operator
Quote from the >:"""int *p = &ia[2]; // ia[] is a int-type array, it contains 5 elements.int j = p[1];int k = p[-2];This last example points out an imiportant difference between arrays an
2013-12-27 17:14:19
613
转载 the difference between : cbegin(cend) and begin(end)
cbegin(cend):Return const_iterator to beginningReturns a const_iterator pointing to the first element in the container.A const_iterator is an iterator that points to const content. This iter
2013-12-26 09:36:17
8334
转载 A difference between decltype and auto?
Quote from the Books: On the other hand, the dereference operator is an example of an expression for which decltype returns a reference. As we've seen, when we dereference a pointer, we get the obje
2013-12-22 11:06:37
632
原创 a puzzle: "decltype definition"
Today, I found a puzzle of "decltype definition"... it's relative to the reference...example:#include int main(){const int ci = 0, &cj = ci;decltype(ci) x = 0;decltype(ci) y = x;std::cou
2013-12-19 12:27:02
433
原创 tips for constexpr and Constant Expressions
A constant expression is an expression whose value cannot change and that can be evaluated at compile time.A typical characteristic: the constant express will be evaluated at compile time, not at ru
2013-12-18 16:33:08
640
转载 The pointers in C++ primer
What's the difference between the references and pointer?the common:they are used for indirect access to other objects.the differences:1.) a pointer is an object in itw own right. Pointers can
2013-12-17 10:01:10
415
原创 An interested program for cookie
#include int me = 42;int me2 = 42;int main(){std::cout << me << std::endl;me = 33;std::cout << me << std::endl;std::cout << ::me << std::endl;int me2 = 33;std::cout << me2 << std::endl;
2013-12-16 15:50:46
473
转载 C++ Keywords Alternative Operator Names
C++ Keywords:alignascontinuefriendregistertruealignofdecltypegotoreinterpret_casttryasmdefaultifreturntypedefautodeleteinlineshorttypeid
2013-12-16 14:34:51
668
原创 Quark:A Big MCU.....
Recently, I noticed a new SOC: Quark. It sounds like the meaning as the name. A tiny CPU.. Okay, It should be named SOC ( System on Chip)Abviously, It include a Memory Controller, A group of gener
2013-12-06 09:25:36
707
原创 ShortCut keys for Codeblocks you need know
Editor:FunctionShortcut KeyUndo last actionCtrl-ZRedo last actionCtrl-Shift-ZSwap header / SourceF11Comment highlighted codeCtrl-Shift-CUncomment high
2013-12-03 21:27:23
902
转载 The ShortKey for Gvim & Vim
----------------------------------------# 基础----------------------------------------* # g* g# : 寻找光标处的狭义单词() (前向/后向)% : 括号配对寻找 {}[]()matchit.vim : 使得 % 能够配对标
2013-11-16 16:34:37
899
原创 An answer for C++ excercise
It's shown on the C++ prime plus:You would see it if you follow the step ..I just want make a record, it takes me some times... On page: 301The excercise:Write a program that reads inp
2013-11-08 09:26:45
604
原创 Records: The concepts of cin.get..
If you are n't cookie, please skip it ... Thanksfrom now on, I get two methods or ways to use it:cin.get(name,ArSize).get()cin.get(ch);It's really confuse me right now. I Know C language, the
2013-10-12 09:53:46
495
原创 c++: the hint of pointer
Okay. Today i get a new concept about pointer:I usually treat pointer as a tag of address. But now I think i made some mistakes.First of all: when a pointer point to the the first of address
2013-10-09 13:11:10
463
转载 C++ :: delete
It's important to make a distinction between:1. "Pointer" as a variable residing on the stack. The name tempb refers to one such variable.2. "Pointer" as an integer value that refers to a memory l
2013-10-08 10:41:58
440
原创 c++ basic thoughts: char array
//strtype3.cpp .. more string class features#include #include #include // C-styple string libraryint main(){ using namespace std; char charr1[20]; char charr2[20]
2013-10-01 10:51:33
519
原创 c++ trap: the character array & string
#include #include int main(){ using namespace std; char charr1[20]; char charr2[20] = "jaguar"; string str1; string str2 = "panther"; cout cin >> charr1;
2013-09-30 21:09:53
720
原创 C++ Knowledge: The separate type for address
#include int main(){ using namespace std; int hand[4] = {1,2,3,4}; int things[] = {1,5,3,8}; int i, num = sizeof(things) / sizeof(int); cout cout cout
2013-09-29 22:01:45
384
原创 the trap: c++'s array
#include int main(){ using namespace std; int yam[3]; yam[0] = 7; yam[1] = 8; // why it can't report the warnning? when yam[3] is existed? yam[3] = 6; //
2013-09-29 21:03:17
464
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人