文件读写问题 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}'/ ......
给一个字符串、例如 “ababc”要求返回“ab”. 因为“ab”连续重复出现且最长。 用C/C++语言写一函数完成该算法,给出复杂度
这个题我不会
C/C++ code:
#include <iostream>
#include <s ......
打印一个N*N的方阵,N为每边字符的个数( 3〈N〈20 ),要求最外层为"X",第二层为"Y",从第三层起每层依次打印数字0,1,2,3,...
例子:当N =5,打印出下面的图形:
X X X X X
X ......
const int num=100
float neiji(float [num]b, float [num]c)
{
int p;
float nj ......
编译普通的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/../../. ......