ÔÚ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)
& ......
Data Type Ranges
C/C++ recognizes the types shown in the table below.
Type Name Bytes Other Names Range of Values
&nb ......
ʹÓÃC/C++À©Õ¹Python
·Òë:
gashero
Èç¹ûÄã»áÓÃC£¬ÊµÏÖPythonǶÈëÄ£¿éºÜ¼òµ¥¡£ÀûÓÃÀ©Õ¹Ä£¿é¿É×öºÜ¶àPython²»·½±ã×öµÄÊÂÇ飬ËûÃÇ¿ÉÒÔÖ±½Óµ÷ÓÃC¿âºÍϵͳµ÷Óá£
ΪÁËÖ§³ÖÀ©Õ¹£¬Python API¶¨ÒåÁËһϵÁк¯Êý¡¢ºêºÍ±äÁ¿£¬ÌṩÁ˶ÔPythonÔËÐÐʱϵͳµÄ·ÃÎÊÖ§³Ö¡£PythonµÄC APIÓÉCÔ´Âë×é³É£¬²¢°üº¬ “Python.h” Í·Îļ ......
µ÷ÊÔkeil³ÌÐòʱÓÐʱ»á³öÏÖ¸÷ÖÖ±àÒ뾯¸æ£¬Ò»°ãÇé¿öϲ»»áÓ°Ïì³ÌÐòµÄÔËÐС£µ«³öÏÖÈçÌâWARNING:MULTIPLE CALL TO SEGMENT¾¯¸æÊ±£¬ÇëÁôÒâÄúµÄ³ÌÐòÊÇ·ñ»á·¢Éú´íÎó¡£ÉÏÊö¾¯¸æÖ¸µÄÊÇÄ㶨ÒåµÄº¯ÊýÌåÔÚÖ÷³ÌÐòÖб»µ÷Óã¬ÔÚÖжÏÖÐÒ²±»Ö±½Ó»ò¼ä½ÓµÄµ÷ÓÃÁË¡£¿ÉÏëÈôÖ÷³ÌÐòÕýÔËÐд˺¯Êýʱ£¬ÖжÏÀ´ÁÙÒ²ÔËÐÐÕâ¶Î³ÌÐòµÄ»°»á·¢Éúº¯ÊýÖØÔØÏÖÏó¡£ ......
#include "stdafx.h"
#include <stdio.h>
#include <windows.h>
#include <math.h>
#include <conio.h>
typedef struct {
short int pitch;
short int duration;
} NOTE;
NOTE notes[] = {{14, 500}, {16, 500}, {12, 500 ......