gcc编译时为什么老是提示警告?test10.c:56: warning: implicit declaration of function ‘toascii’

hkn222 2012-08-22 07:31:16

1 #include <stdio.h>
2 #include <ctype.h>
3
4 #define STR_LEN 100
5 #define LIMIT 10
6
7 int input_string(char *[],int);
8 int printf_s(char *[],int);
9 int printf_as(char *[],int);
10
11
12 int main(void)
13 {
14 char str[LIMIT][STR_LEN];
15 char *pt[LIMIT];
16 for(int j=0;j<LIMIT;j++)
17 pt[j]=str[j];
18 int tag=input_string(pt,LIMIT);
19 printf_s(pt,tag);
20 printf_as(pt,tag);
21 return 0;
22 }
23
24 int input_string(char *ps[],int num)
25 {
26 int tag=0;
27 printf("please enter %d String \n",num);
28 for(int i=0;i<num&&fgets(ps[i],STR_LEN,stdin)!=NULL&&*ps[i]!='\n';i++)
29 {
30 printf("please enter %d String \n",num-i-1);
31 tag=i+1;
32
33 }
34 return (tag? tag:0);
35 }
int printf_s(char *ps[],int num)
38 {
39 printf("printf of string:\n");
40 if(num)
41 {
42 for(int i=0;i<num;i++)
43 {
44 fputs(ps[i],stdout);
45 }
46 }
47 printf("\n");
48 }
49
50 int printf_as(char *pt[],int tag)
51 {
52 printf("printf of ascii:\n");
53 for(int i=0;i<tag;i++)
54 {
55 while(*pt[i]!='\0')
56 printf("%d",(int)toascii((int)*pt[i]++));
57 printf("\n");
58 }
59 }
...全文
430 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
shen_wei 2012-08-23
  • 打赏
  • 举报
回复
[Quote=引用 2 楼 的回复:]
__toascii
Converts characters.

int __toascii( int c );

Routine Required Header Compatibility
__toascii <ctype.h> Win 95, Win NT
[/Quote]

注意用法。。看看linux中是否有这个函数。。
hkn222 2012-08-23
  • 打赏
  • 举报
回复
[Quote=引用 2 楼 的回复:]

__toascii
Converts characters.

int __toascii( int c );

Routine Required Header Compatibility
__toascii <ctype.h> Win 95, Win NT
[/Quote]


SYNOPSIS
#include <ctype.h>

DESCRIPTION
Some of the functionality described on this reference page extends the
ISO C standard. Applications shall define the appropriate feature test
macro (see the System Interfaces volume of IEEE Std 1003.1-2001, Sec-
tion 2.2, The Compilation Environment) to enable the visibility of
these symbols in this header.

The following shall be declared as functions and may also be defined as
macros. Function prototypes shall be provided.

int isalnum(int);
int isalpha(int);

int isascii(int);

int isblank(int);
int iscntrl(int);
int isdigit(int);
int isgraph(int);
int islower(int);
int isprint(int);
int ispunct(int);
int isspace(int);
int isupper(int);
int isxdigit(int);

int toascii(int);

int tolower(int);
int toupper(int);

The following are defined as macros:

int _toupper(int);
int _tolower(int);
Gloveing 2012-08-22
  • 打赏
  • 举报
回复
__toascii
Converts characters.

int __toascii( int c );

Routine Required Header Compatibility
__toascii <ctype.h> Win 95, Win NT
Gonefar 2012-08-22
  • 打赏
  • 举报
回复
toascii这个函数式系统的吗?如果不是系统的,你又没定义就会报这样的错误。

69,371

社区成员

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

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