当前位置: 代码迷 >> malloc的解决方案
 
  • [求助]用指针直接获取键盘输入

    [求助]用指针直接获取键盘输入 #include<stdio.h>intmain(){int*a,*b,t;scanf("%d%d",a,b);t=*a;*a=*b;*b=t;printf("%d%d",*a,*b);getch();return0;}运行后就出问题要关闭用的是devcpp哪个高手帮忙解答一下 搜索更多相关的解决方案: ...

    133
    热度
  • [原创]大整数乘法

    整个程序的源码: #include<stdio.h> #include<string.h> #include<malloc.h>#defineMAX255typedefstruct {inta[MAX]; intflag; }shu;voidstrtoi(char*q,inta[]) {inti; for(i=0;i<strlen(q);i++) a[i...

    425
    热度
  • 苦恼的程序啊

    苦恼的程序啊 #defineNULL0#definelensizeof(structzhi)#include"stdio.h"structzhi{inta;structzhi*next;};structzhi*creat(){structzhi*p1;structzhi*p2;structzhi*head;intn=0;p1=p2=(structzhi*)malloc(...

    119
    热度
  • [求助]关于超长数的加法问题

    [求助]关于超长数的加法问题 #include<stdio.h>#include<conio.h>#defineN10000typedefstructnode{intn;structnode*next;}r,*pr; prinputint(){prp,q=NULL,q1=(pr)malloc(sizeof(r)),p1=q1,p2=q1;inti...

    420
    热度
  • [求助]我有一些问题想请教你们.

    [求助]我有一些问题想请教你们. 给定程序中已建立一个带有头结点的单向链表,链表中的各结点按结点数据域中的数据从小到大顺序链接。函数fun的功能是:把形参x的值放入一个新结点并插入到链表中,插入后各结点仍保持从小到大顺序排列。请在程序的下划线处填入正确的内容并把下划线删除,使程序得出正确的结果。注意:源程序存放在考生文件夹下的BLANK1.C中。不得增行或删行,也不得更...

    226
    热度
  • 数据结构上的题目 不知道问题出再哪?

    数据结构上的题目不知道问题出再哪? /*程序是数据结构上改的*/ #include<stdio.h> #include<malloc.h> #defineNUM80 #defineLENsizeof(STRING) typedefstructstring { intlen; charch[NUM]; }STRING; intStrCompare(...

    215
    热度
  • 求教链表的基础问题

    求教链表的基础问题 #include"stdafx.h" #include<stdio.h> #include<malloc.h> #defineLENsizeof(structline) #defineNULL0 structline { inta; intb; intc; structline*next; }; intn;...

    194
    热度
  • 求救,在线等!~

    求救,在线等!~ 我希望用动态分配做出:输入:whoareyou 输出:who are you 希望能有人帮帮我。。。 #include&lt;stdio.h&gt; #include&lt;stdlib.h&gt; #include&lt;malloc.h&gt; voidmain() { char*p,*px; p=...

    247
    热度
  • [求助]删除结点的问题

    [求助]删除结点的问题 #include<malloc.h>#defineNULL0#defineLENsizeof(structstudent)structstudent{longnum;floatscore;structstudent*next;};intn;structstudent*cread(void){structstudent*head;str...

    350
    热度
  • [求助]请帮帮忙啊,看看这个程序哪里出错

    [求助]请帮帮忙啊,看看这个程序哪里出错 #include<malloc.h>#defineNULL0#defineLENsizeof(structstudent)structstudent{longnum;floatscore;structstudent*next;};intn;structstudent*creat(void){structstudent...

    189
    热度
  • 这程序错在那啊?????

    这程序错在那啊????? 请高帮帮忙,这个程序错在那?怎样修正????#include<stdio.h>#include<malloc.h> #defineNULL0#defineLENsizeof(structstudent) structstudent{longnum;floatscore;structstudent*next;};intn;...

    156
    热度
  • 吖[求助]多项式相加出现死循环

    比如(5x^5+4x^4+…+1)+(4x^3+5x+8)=?这样吗?我说的是具体要求,最好给个例子说明好些。这样不明不白的, color='#FF8000'>----------------解决方案-------------------------------------------------------- 一元多项式的相加...

    343
    热度
  • [求助]关于fread读数据时的问题

    [求助]关于fread读数据时的问题 我们的课程设计要求用十字链表结构建立十字链表没有问题然后我用fwrite存好也没错接着用fread读的时候问题来了当我把第一层结点定义如下structcol{unsignedlongcolnum;charcolname[10];structcol*next;structcour*first;unsignedm;/*下一层结点计数*/...

    391
    热度
  • 一个关于指针的小程序,不知道什么意思(已解决)

    一个关于指针的小程序,不知道什么意思(已解决) 这个程序到底在干嘛呀?请各位高手帮忙解释一下,输出结果为多少?#include<stdio.h>main(){int*p[5];int*ptr,i;if((ptr=malloc(100*sizeof(int)))!=NULL){p[0]=ptr;for(i=1;i<5;i++)p[i]=p[i-1]+7;...

    132
    热度
  • [求助]关于双链表的建立与输出问题

    [求助]关于双链表的建立与输出问题 今天刚学完那个双链表的有关知识,可遇到了一些问题。我这个程序的要求事建一个双链表,头节点事空的。建好后输出。我的程序是这样的;#include<stdio.h>#include<malloc.h> structaa{intinfo;structaa*left,*right;};structaa*creat(){...

    161
    热度
  • 谁帮我看看哪里错了

    谁帮我看看哪里错了 输入N个字符串比较大小从小到大输出 #include<stdio.h> voidmain() { char(*q)[20],a[20]; inti,j,m; scanf("%d",&m); q=(char*)malloc(m*20); for(i=0;i<m;i++) { scanf("%s",q+i); } for(...

    159
    热度
  • 链表删除问题?

    链表删除问题? #include"stdio.h" typedefstructnode {intdata; structnode*next; }NODE; intx,i; NODE*creat() {NODE*head,*p,*s; intx; head=(NODE*)malloc(sizeof(NODE)); p=head; printf(&quo...

    121
    热度
  • [求助]卧龙孔明进来看下!

    [求助]卧龙孔明进来看下! #include<stdio.h>#include<malloc.h>#include<stdlib.h>#include<string.h>#defineNULL0#defineLENsizeof(structstudent)typedefstructstudent{intnum;charna...

    142
    热度
  • [讨论]还是关于链表的问题

    [讨论]还是关于链表的问题 程序如下:#include<stdio.h>#include<malloc.h>#include<stdlib.h>structlist{intdata;structlist*next;};voidprint(structlist*head);voidinsert(structlist*head); voi...

    144
    热度
  • [求助]关于指针分配内存的问题

    [求助]关于指针分配内存的问题 这是我去一家公司的面试题目,麻烦大家帮忙解决一下谢谢!voidGetMemory(char*p){p=(char*)malloc(100);}voidTest(void){char*str=NULL;GetMemory(str);strcpy(str,"Hello!");printf("%s",str);}请问上述程序在运行时候有什么错误...

    283
    热度