ÔÚAIX»úÆ÷ÉϵÄC³ÌÐò
¡¾checkpass.c¡¿
#include <stdio.h>
#include <string.h>
int checkpass(void){
int x;
char a[9];
x = 0;
fprintf(stderr,"a at %p and\nx at %p\n", (void *)a, (void *)&x);
printf("Enter a short word: ");
scanf("%s", a);
if (strcmp(a, "mypass") == 0)
x = 1;
return x;
}
[make.c]
#include <stdio.h>
int checkpass(void);
int main(void)
{
int x;
x = checkpass();
fprintf(stderr, "x = %d\n", x);
if (x)
fprintf(stderr, "Password is correct!\n");
else
fprintf(stderr, "Password is not correct!\n");
return 0;
}
[makefile]
LINT = lint ## lint check Code
LOPS = -x #-u
CC = cc #xlc ## ×¢Ò⣺´óд'C' for c++
CC_FLAGS = #-q64 #-bnoquiet
INCLUDE= #-I. -I/usr/include -I/usr/vacpp/include
LIBPATH=#-L/usr/vacpp/lib -L/usr/lib -L/lib
PROGRAM = run
ALL : $(PROGRAM)
.SUFFIXES: .cpp .c .cc .cxx .o
.DEFAULT : all
SRCS = main.c checkpass.c
OBJS = $(SRCS:.c=.o)
$(PROGRAM) : $(OBJS)
$(CC) $(CC_FLAGS) $(INCLUDE) $(LIBPATH) $(OBJS) -o $(PROGRAM)
.c.o:
$(CC) $(INCLUDE) $(CC_FLAGS) -c $<
lintall: lint
lint:
$(LINT) $(LOPS) main.c checkpass.c
clean:
- rm -f ./*.o ./*.a ./$(PROGRAM)
[end]
Ïà¹ØÎĵµ£º
¶þ·Ö²éÕҵĴúÂë.
int bfind(int* a,int len,int val)
{
int m = len/2;
int l = 0;
int r = len;
while(l!=m && r!= m)
{
if(a[m] > val)
& ......
²Ù×÷ϵͳµÄÒ»¸ö¾µäÎÊÌâÊÇ"Éú²úÕß-Ïû·ÑÕß"ÎÊÌâ, ÕâÉæ¼°Í¬²½ÐźÅÁ¿ºÍ»¥³âÐźÅÁ¿µÄÓ¦ÓÃ, ÔÚÕâÀï,ÎÒÓÃÏ̵߳Äͬ²½ºÍ»¥³âÀ´ÊµÏÖ.
/*
* author ÕÅÎÄ
* 2008/06/20
*/
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <pthread.h>
#include <semaphore.h> ......
ÔÚÕâÀïÌùÉÏ×î½ü×Ô¼ºÃ¦»îµÄÓÃturbo C±àдµÄ“´ò×ÖÓÎÏ·”µÄÔ´´úÂ룺
#include<graphics.h>
#include<conio.h>
#include<STDLIB.h>
#include<dos.h>
#define BK_COLOR BLACK
#define CHAR_COLOR WHITE
#define C_COLOR BLUE
#define num 10
#define SPEED 3000
#define Esc 27
# ......
C³ÌÐòÖоßÓзḻµÄÊý¾ÝÀàÐÍ£¬°üÀ¨ÉùÃ÷ÖÐÏÔʽ¶¨ÒåµÄÀàÐͺÍÓÃ×ö±í´ïʽÖмäÀàÐ͵ĵ¼³öÀàÐÍ¡£ÀýÈ磬ÏÂÃæµÄ¸³ÖµÓï¾ä°üº¬3 ÖÖ²»Í¬ÀàÐÍ:
int *p, x;
*p = x;
xÊÇÒ»¸ö´æ·ÅÕûÊýµÄµ¥ÔªµÄµØÖ·£¬Òò´ËxµÄµØÖ·µÄÀàÐÍÊÇ£ºÖ¸ÏòÒ»¸öÕûÊýµÄÖ¸Õë¡£xµÄÖµµÄÀàÐÍÊÇÕûÐÍ¡£Í¬Ñù, pµÄ×óÖµµÄÀàÐÍÊÇÖ¸ÏòÒ»¸öÕ ......
×ÔÓɵĸèÒ¥
¡¡¡¡±¾ÊéÊÇ×ÔÓÉÈí¼þ´ÔÊéµÄÒ»²¿·Ö£¬Ò²ÊÇÒ»Ê××ÔÓɵĸèÒ¥¡£
¡¡¡¡±¾ÊéÖвûÊöµÄGNU C¿â£¬¶¨ÒåÁËËùÓÐÔÚISO C±ê×¼Ëù¹æ¶¨µÄ£¬ÒÔ¼°POSIX±ê×¼¡¢ÆäËüÏà¹Ø±ê×¼ºÍUNIXϵͳËùÅÉÉúµÄ±ê×¼Öж¨ÒåµÄËùÓк¯Êý£¬ÎªGNU²Ù×÷ϵͳËùÖ§³Ö¡£
C³ÌÐòÉè¼ÆÓïÑÔÌṩÖîÈçÊäÈë/Êä³ö¡ ......