文件读写问题 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("通讯地址: ");
&
相关问答:
给一个字符串、例如 “ababc”要求返回“ab”. 因为“ab”连续重复出现且最长。 用C/C++语言写一函数完成该算法,给出复杂度
这个题我不会
C/C++ code:
#include <iostream>
#include <s ......
本人对C特别感兴趣,希望志同道合的人一起交流,另外还可以一起讨论linux问题
QQ群:17409844
有兴趣的同志加下
顶个.
帮顶……
不过确实对群失望了>_ <
顶上
顶一个
请接受啊
&nbs ......
大家帮我看看这个代码,有很多问题,不知道怎么改,小弟在此谢谢了。
#include <stdio.h>
#include <conio.h>
#include <ctype.h>
float date1,date2;
char op;
void ......
希望祖国更加繁荣昌盛
我和我的祖国
一刻也不能分割
无论我走到哪里
都流出一首赞歌
我歌唱每一座高山
我歌唱每一条河
袅袅炊烟小小村落
路上一道辙
啦~~~啦~~~
你用那你母亲的温 ......