文件读写问题 c高手请进
下面是我的代码 从内存写入文件正确 但从文件读入内存都是乱码 而且程序崩溃 请c高手指点
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
struct inf
{
char name[10];
char address[20];
long number;
long telnumber;
struct inf *next;
};
struct inf *input(struct inf *head)
{
struct inf *p,*q;
int i,population;
if(head!=NULL)
{
p=q=head;
while(p!=NULL)
{
q=p;
p=p->next;
}
}
printf("请输入要输入的人数!\n");
scanf("%d",&population);
for(i=0;i <population;i++)
{
p=(struct inf *)malloc(sizeof(struct inf));
printf("姓名: ");
scanf("%s",p->name);
printf("通讯地址: ");
&
相关问答:
在查询后将查询出来的值赋给各输入框
<c:if test="${not empty dataValue}">
fm.SAMPLING_DATE.value=" <c:out value='${dataValue.SAMPLING_DATE}'/ ......
本人对C特别感兴趣,希望志同道合的人一起交流,另外还可以一起讨论linux问题
QQ群:17409844
有兴趣的同志加下
顶个.
帮顶……
不过确实对群失望了>_ <
顶上
顶一个
请接受啊
&nbs ......
运行环境是unix,我用ue以ftp方式连到unix上,然后在ue中编写c程序,但在unix下用vi看程序时,每行后面都多了一个^M,这个应该是unix的换行符,每次只能删除一遍然后才能编译,否则会报错,请问这是在ue中字符编码的 ......
编译普通的c没问题啊,但编译javah生成的就报错:
gcc -O0 -g3 -Wall -c -fmessage-length=0 -oHelloWorld.o ..\HelloWorld.c
gcc -otest.exe HelloWorld.o
d:/MinGW/bin/../lib/gcc/mingw32/3.4.5/../../. ......