C¼¼ÇÉʰÒÅ~
1. ÔõÑù½¨Á¢ºÍÀí½â·Ç³£¸´ÔÓµÄÉùÃ÷£¿ÀýÈ綨ÒåÒ»¸ö°üº¬N ¸öÖ¸Ïò·µ»ØÖ¸Ïò×Ö·ûµÄÖ¸ÕëµÄº¯ÊýµÄÖ¸ÕëµÄÊý×飿
Õâ¸öÎÊÌâÖÁÉÙÓÐÒÔÏÂ3 ÖÖ´ð°¸:
1. char *(*(*a[N])())();
2. ÓÃtypedef Öð²½Íê³ÉÉùÃ÷:
typedef char *pc; /* ×Ö·ûÖ¸Õë*/
typedef pc fpc(); /* ·µ»Ø×Ö·ûÖ¸ÕëµÄº¯Êý*/
typedef fpc *pfpc; /* ÉÏÃæº¯ÊýµÄÖ¸Õë*/
typedef pfpc fpfpc(); /* ·µ»Øº¯ÊýÖ¸ÕëµÄº¯Êý*/
typedef fpfpc *pfpfpc; /* ÉÏÃæº¯ÊýµÄÖ¸Õë*/
pfpfpc a[N]; /* ÉÏÃæÖ¸ÕëµÄÊý×é*/
2. *p++ ×ÔÔöp »¹ÊÇp ËùÖ¸ÏòµÄ±äÁ¿£¿
ºó׺++ ºÍ-- ²Ù×÷·û±¾ÖÊÉϱÈǰ׺һĿ²Ù×÷µÄÓÅÏȼ¶¸ß, Òò´Ë*p++ ºÍ*(p++) µÈ¼Û, Ëü×ÔÔöp ²¢·µ»Øp ×ÔÔö֮ǰËùÖ¸ÏòµÄÖµ¡£Òª×ÔÔöp Ö¸ÏòµÄÖµ, ʹÓÃ(*p)++, Èç¹û¸±×÷ÓõÄ˳ÐòÎ޹ؽôÒªÒ²¿ÉÒÔʹÓÃ++*p¡£
ÍØÕ¹£º
void func()
{
int i = 2;
int j = 5;
int *p = &i;
printf("result :%d\n",*(--p));
}
Êä³ö£º
result :5
ÔÒò£ºÕ»ÊÇÏòµÍµØÖ·À©Õ¹µÄÊý¾Ý½á¹¹£¡
3.ÔõÑùÅжϻúÆ÷µÄ×Ö½Ú˳ÐòÊǸß×Ö½ÚÔÚǰ»¹ÊǵÍ×Ö½ÚÔÚǰ£¿
ÓиöʹÓÃÖ¸ÕëµÄ·½·¨£º
int x = 1;
if(*(char *)&x == 1)
printf("little-endian\n");
else
printf("big-endian\n");
Ïà¹ØÎĵµ£º
ÒªÈà Eclipse ¿ÉÒÔ¿ª·¢ C/C++ ³Ìʽ£¬Òª¹ÒÉÏ CDT ²Å¿ÉÒÔ¡£
Ê×ÏÈÒªÏÂÔØCDT
CDTµÄ×îа汾ÊÇ 3.1.0£¬ËüÖ§³Öeclipse3.2.0£¬ÆäÏÂÔØµØÖ·£ºhttp://download3.eclipse.org/tools/cdt/releases/callisto/dist/3.1.0/£¬»òÕßÊǵ½http://www.eclipse.org/cdt/downloads.phpÏÂÔØÆäËü° ......
/*
* File: main.cpp
* Author: Vicky
*
* Created on 2010Äê5ÔÂ8ÈÕ, ÏÂÎç2:47
*/
#include <iostream>
using namespace std;
void swap(int x, int y) {
cout << "x and y swap before : " << x << "\t" << y << endl;
int i = x;
x = y;
y = i; ......
http://en.wikipedia.org/wiki/C_preprocessor
C preprocessor
from Wikipedia, the free encyclopedia
Jump to:navigation, search
The C preprocessor (cpp) is the preprocessor for the C programming language. In many C implementations, it is a separate program invoked by the compiler as the first part ......
#include<stdio.h>
#define N 8
void input(int n,int p[N][N])
{
int i,j;
for(i=0;i<n;i++)
{
printf("please input the %d line:\n",i+1);
for(j=0;j<n;j++)
{
scanf("%d",&p[i][j]);
}
}
}
void output(int n,int p[N][N])
......
Àý) Σ険¤Ê¥³ー¥Ç¥£¥ó¥°
1 char cStr[256];
2 ZeroMemory(cStr, sizeof(cStr));
3 &nb ......