在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)
& ......
搞软件是有搞头的
——邹祁峰
2009年12月3日
声明:所说的只针对C、C++、.NET专业的同学,对其他专业也许没有参考价值!
[推荐给大三的学弟学妹们]
【欢迎各位朋友补充】
对我个人而言,大学毕业找工作算是画上了一个许多人羡慕,但我自己仍感遗憾的句号。找工作期间 ......
#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下
运行光盘工具 ......