ÔÚ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 main()
{
vector<int> a;
int i(0);
while(cin>>i)
a.push_back(i);
//////////////////////////////////////////////////////Êä³ö½¨Á¢µÄÊý×飺
cout << "µÃµ½µÄÊý×éΪ£º" << ......
1.ÒýÑÔ
¡¡¡¡C++ÓïÑԵĴ´½¨³õÖÔÊÇ“a better C”£¬µ«ÊÇÕâ²¢²»Òâζ×ÅC++ÖÐÀàËÆCÓïÑÔµÄÈ«¾Ö±äÁ¿ºÍº¯ÊýËù²ÉÓõıàÒëºÍÁ¬½Ó·½Ê½ÓëCÓïÑÔÍêÈ«Ïàͬ¡£×÷ΪһÖÖÓûÓëC¼æÈݵÄÓïÑÔ£¬C++±£ÁôÁËÒ»²¿·Ö¹ý³ÌʽÓïÑÔµÄÌØµã£¨±»ÊÀÈ˳ÆÎª“²»³¹µ×µØÃæÏò¶ÔÏ󔣩£¬Òò¶øËü¿ÉÒÔ¶¨Òå²»ÊôÓÚÈκÎÀàµÄÈ«¾Ö±äÁ¿ºÍº¯Êý¡£µ«ÊÇ£¬C++±Ï¾ ......
#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 ......
1. ×¼±¸¹¤×÷£º
¿ª·¢°åµÄipÉèÖÃ
gzsd> net set ipaddr 192.168.0.11 ÉèÖÿª·¢°åµÄIP
gzsd> net set serverip 192.169.0.10 ÉèÖÃtftp serverµÄIP
gzsd> net set netmask 255.255.255.0 ÉèÖÃ×ÓÍøÑÚÂë
gzsd> net save ±£´æÉèÖÃ
gzsd> net ping XXX ²âÊÔÁ¬½Ó×´¿ö
°²×°tftp·þÎñÆ÷
windowsÏÂ
ÔËÐйâÅ̹¤¾ß ......