当前位置: 代码迷 >> C语言 >> 关于C中语法的问题!
  详细解决方案

关于C中语法的问题!

热度:138   发布时间:2005-03-22 15:35:00.0
关于C中语法的问题!
关于数据结构中栈的应用  用C编译后  下面一句有问题   
Status visit(SElemType * e)
望能指教!
原程序如下:

#include<stdio.h>
#include<malloc.h>
#include<conio.h>

typedef int SElemType;

#include "stack.h"

Status Visit(SElemType * e)
{
  printf(" %d  ", *e);
}

void conversion()
{
pSqStack S;
SElemType e;

int n;
InitStack(&S);
printf("Input a number to convert to OCT:\n");
scanf("%d",&n);

if(n<0)
   {
     printf("\nThe number must be over 0.");
     return;
   }
if(!n) Push(S,0);

while(n){
   Push(S,n%8);
   n=n/8;
}

printf("the result is:        ");
while(!StackEmpty(*S)){
   Pop(S,&e);
   printf("%d",e);
}
}

main()
{
  printf("\n\n\n\n");
  conversion();
  getch();
  printf("\n\nRight");
}
搜索更多相关的解决方案: 语法  

----------------解决方案--------------------------------------------------------
  相关解决方案