奇怪的问题

wsh1688 2004-12-25 12:01:13
#include "stdio.h"
struct person
{
char name[30];
unsigned long tel;
char add[50];
};
addSubscriber(void)
{
struct person Sbuscriber;
char numstr[20];
printf(" Add new Subscriber details\n");
printf("Enter Subscriber name:");
gets(Sbuscriber.name);

do
{
printf("\nEnter Subscriber Telephone Number:");
gets(numstr);
Sbuscriber.tel=atol(numstr);
}
while(Sbuscriber.tel<45);

printf("\nEnter Subscriber Address:");
gets(Sbuscriber.add);
printf("\n Name Address Telephone\n");
printf("%-10s%-50s%81d",Sbuscriber.name,Sbuscriber.add,Sbuscriber.tel);
}

void menu(void) /*display menu*/
{
char choice;
printf("TELEPHONE DIRECTORY SYSTEM.\n");
printf(" 1.Add new subscriber details\n");
printf(" 2.Modify existing subscriber details\n");
printf(" 3.delete existing subscriber details\n");
printf(" 4.Display subscriber details based on telphone number\n");
printf(" 5.Display subscriber details based on subscriber name\n");
printf(" 6.View Directory\n");
printf(" 7.Quit\n");
do
{
choice = getchar();
switch(choice)
{
case'1':
break;
case'2':
break;
case'3':
break;
case'4':
break;
case'5':
break;
case'6':
break;
case'7':
exit(0);

}
}while(1);
}

main()
{
addSubscriber();

}

我在结构里声明了一个long变量但是实际用的时候类型却是short我百思不得其解,疑惑

各位高手帮俺解决解决!

...全文
149 7 打赏 收藏 转发到动态 举报
写回复
用AI写文章
7 条回复
切换为时间正序
请发表友善的回复…
发表回复
Roaming_Sheep 2004-12-26
  • 打赏
  • 举报
回复
sigh
1。没有注释的程序,一看就头大,谁还会帮你看?
2。你的问题描述的莫名其妙,怎么帮你分析?(“实际用的时候类型却是short”,从何处看出这一点?你把你发现这个问题的具体情况描述一下,标出出现问题的可能语句等等,别人才容易帮你找问题)

只会叫“大哥帮帮我”,却连帮什么都不说清楚,别人怎么帮
wsh1688 2004-12-26
  • 打赏
  • 举报
回复
up
hy198508 2004-12-26
  • 打赏
  • 举报
回复
同意楼上的!
avalonBBS 2004-12-25
  • 打赏
  • 举报
回复
怎么会~!?
wsh1688 2004-12-25
  • 打赏
  • 举报
回复
大哥们帮帮我
我的作业快交拉
wsh1688 2004-12-25
  • 打赏
  • 举报
回复
我在结构里声明了一个long变量但是实际用的时候类型却是short我百思不得其解
「已注销」 2004-12-25
  • 打赏
  • 举报
回复
具体点

69,371

社区成员

发帖
与我相关
我的任务
社区描述
C语言相关问题讨论
社区管理员
  • C语言
  • 花神庙码农
  • 架构师李肯
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧