| |

VerySource

 Forgot password?
 Register
Search
View: 634|Reply: 6

A simple question: compile with cc or gcc under Linux: error: 'strupr'

[Copy link]

1

Threads

3

Posts

4.00

Credits

Newbie

Rank: 1

Credits
4.00

 China

Post time: 2020-1-27 22:20:01
| Show all posts |Read mode
Compiled by cc or gcc under Linux
 error: 'strupr' was not declared in this scope
How to do
Reply

Use magic Report

1

Threads

3

Posts

4.00

Credits

Newbie

Rank: 1

Credits
4.00

 China

 Author| Post time: 2020-2-22 07:45:02
| Show all posts
The same code can be compiled normally under win, and the above problems occur under linux
Reply

Use magic Report

0

Threads

73

Posts

46.00

Credits

Newbie

Rank: 1

Credits
46.00

 Invalid IP Address

Post time: 2020-2-22 15:15:01
| Show all posts
strupr is not a standard C library function.
Reply

Use magic Report

0

Threads

73

Posts

46.00

Credits

Newbie

Rank: 1

Credits
46.00

 Invalid IP Address

Post time: 2020-2-22 22:30:02
| Show all posts
It should be VC's own expansion.
Reply

Use magic Report

1

Threads

3

Posts

4.00

Credits

Newbie

Rank: 1

Credits
4.00

 China

 Author| Post time: 2020-2-23 21:00:01
| Show all posts
What to do
Reply

Use magic Report

0

Threads

73

Posts

46.00

Credits

Newbie

Rank: 1

Credits
46.00

 Invalid IP Address

Post time: 2020-2-23 22:15:01
| Show all posts
Write it yourself, huh.
It is not difficult to process only English ASCII characters.
Reply

Use magic Report

0

Threads

63

Posts

43.00

Credits

Newbie

Rank: 1

Credits
43.00

 China

Post time: 2020-3-1 17:15:01
| Show all posts
char * strupr (char * str)
{
   char * ptr = str;

   while (* ptr! = '\0') {
       if (islower (* ptr))
            * ptr = toupper (* ptr);
       ptr ++;
   }

   return str;
}
Reply

Use magic Report

You have to log in before you can reply Login | Register

Points Rules

Contact us|Archive|Mobile|CopyRight © 2008-2023|verysource.com ( 京ICP备17048824号-1 )

Quick Reply To Top Return to the list