"Compiling principle" lesson notes 2

Source: Internet
Author: User

The following are mainly notes for experiment Two and experiment three:

April 13, 2015 P111.arr,&arr (arr+1), (&arr+1) difference: One variable corresponds to a memory eg. address: 0x10000->&arr content:0x20000-> Arr array is exception: 1) array name arr->&arr[0]  arr[0]->int (first address of array)  INT * *) typedef int Array[10]array a;//sizeof (a)- >40&arr->array*sizeof (arr);->403) so: arr//10000 (arr+1)//10004 (&arr+1)//100402.p395 source code C language Conventions, Right-to-left "argument elevation" int printf (char *fmt,...) {usigned int addr = (usigned int) (&FMT), addr + = sizeof (char*),//1004double *prt = (double*) addr;*prtdouble h = * ((Doub Le *) addr); addr + = sizeof (double);} 3. Experiment two variable argumentva_arg ptr//1iptr//4 do int myprintf (const char,...) {*format}

April 27, 2015 1. is not a virtual method base::h (...); /static bindings pre-compile Base->f (10,20);//dynamic BIND runtime 2. Global variable int c_data;class base{int b_data;static int c_data;void h (int a, int b) {} virtual void f (int a, int b) {}}->struct base{int b_data;}; void Base_h (base* this/* non-static, to point to a method */,int a, int b) void Base_f (base* this/* non-static, to point to a method */,int a, int b) 3.void f (void) {}void g (void) {}typedef void (*func_ptr) (void); void Test (func_ptr ptr) {ptr (); int main () {test (f); Test (g);}

"Compiling principle" lesson notes 2

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.