´Óº¯Êý·µ»ØÒ»¸öÊý×éµÄ2ÖÖ·½·¨ (Cר¼Ò±à³Ì p230)
ÑϸñÀ´Ëµ£¬ÎÞ·¨´Óº¯Êý·µ»ØÒ»¸öÊý×飬µ«¿ÉÒÔ´Óº¯Êý·µ»ØÒ»¸öÖ¸ÏòÈκÎÊý¾Ý½á¹¹µÄÖ¸Õ룬°üÀ¨Ò»¸öÖ¸ÏòÊý×éµÄÖ¸Õë¡£
Ò»ÖÖ·½Ê½ÈçÏ£º
#include <stdio.h>
#include <stdlib.h>
int (*func())[20];//funcÊÇÒ»¸öº¯Êý£¬Ëü·µ»ØÒ»¸öÖ¸Ïò°üÀ¨20¸öintÔªËØµÄÊý×éµÄÖ¸Õë
int main(void)
{
int (*result)[20];
int i = 0;
result = func();
for(i = 0; i < 20; i++){
printf("%d\n", (*result)[i]);
}
free(result);
exit(0);
}
int (*func())[20]
{
int (*a)[20];
int i = 0;
a = calloc(20, sizeof(int));
if(a == NULL){
perror("calloc error");
exit(1);
}
for(i = 0; i < 20; i++){
a[0][i] = i;
}
return a;
}
ǧÍòҪעÒ⣺²»ÄÜ´Óº¯ÊýÖзµ»ØÒ»¸öÖ¸Ïòº¯ÊýµÄ¾Ö²¿±äÁ¿µÄÖ¸Õë¡£
ÁíÒ»ÖÖ·½Ê½ÈçÏ£º
#include <stdio.h>
#include <stdlib.h>
struct tag{
int array[20];
}x, y;
struct tag func(void);
int main(void)
{
&n
Ïà¹ØÎĵµ£º
µ±½ñÓÐÐí¶àÃâ·ÑµÄ RDBMS£¨Relational Database Management
System£¬¹ØÏµÊý¾Ý¿â¹ÜÀíϵͳ£©£¬ÆäÖÐһЩÊÇ¿ª·ÅÔ´ÂëÈí¼þ£¬ÁíһЩÊÇÉÌÒµ³§ÉÌÌṩµÄÃâ·Ñ²úÆ·¡£Èç¹ûÄúÕýÔÚʹÓà C/C++¡¢Java™¡¢.NET
»ò PHP
¿ª·¢Ó¦ÓóÌÐò£¬ÏëѰÕÒÒ»ÖÖ¿É¿¿µÄÊý¾Ý·þÎñÆ÷£¬Ï£ÍûËüÖ§³ÖÏȽøµÄ¼¼Êõ¡¢¾ßÓв»¶ÏÀ©´óµÄ¿ª·¢ÈËÔ±ÉçÇø²¢ÒѾ²¿ÊðÔÚÐí¶à¹Ø¼ ......
CreateThreadº¯Êý
Ç°Ãæ½²¹ý£¬½ø³ÌµÄÖ÷Ï̻߳áÔÚCreateProcessµ÷ÓÃʱ×Ô¶¯´´½¨¡£¼ÙÈçÄãÒªÊÖ¹¤´´½¨Ị̈߳¬Äã¿ÉÒÔµ÷ÓÃCreateThreadº¯Êý£º
HANDLE CreateThread(
PSECURITY_ATTRIBUTES psa,
DWORD cbStackSize,
PTHREAD_START_ROUTINE pfnStartAddr,
PVOID pvParam,
DWORD dwCreateFlags,
PDWORD pdwThreadID) ......
N µ±ÓÃÁ½¸ö²¹Âë±íʾµÄ´ø·ûºÅÊý½øÐÐÔËËãʱ£¬N=1±íʾÔËËãµÄ½á¹ûΪ¸ºÊý£»N=0±íʾÔËËãµÄ½á¹ûΪÕýÊý»òÁã.
Z Z=1±íʾÔËËãµÄ½á¹ûΪÁ㣬Z=0±íʾÔËËãµÄ½á¹û·ÇÁã¡£
C ¿ÉÒÔÓÐ4ÖÖ·½·¨ÉèÖÃCµÄÖµ£º
¼Ó·¨ÔËË㣨°üÀ¨CMN£©£ºµ±ÔËËã½á¹û²úÉúÁ˽øÎ»Ê±£¨ÎÞ·ûºÅÊýÒç³ö£©£¬C=1£¬·ñÔòC=0¡£
¼õ·¨ÔËË㣨°üÀ¨CMP£©£ºµ±ÔËËãʱ²úÉúÁ˽èλʱ£¨ÎÞ·ûºÅÊ ......
#include <iostream.h>
void fun0(int* p)
{
int* a=new int[3];
*a=0;
*(a+1)=1;
*(a+2)=2;
p=a;
}
void fun1(int* &p)
{
int* a=new int[3];
*a=0;
*(a+1)=1;
*(a+2)=2;
p=a;
}
void fun2(int* p)
{
*p=0;
*(p+1)=1;
*(p+2)=2;
}
//warning:returning address of local va ......