rar

C entry-level small example (macro definition)

  • 2013-09-22
  • 2.34KB
  • Points it Requires : 2

C入门级小例子(宏定义)#include#define IS_A_TO_Z(str) (((\'a\'<=str)&&(\'z\'>str))||((\'A\'<=str)&&(\'Z\'>str)))#define IS_Z(str) ((\'z\'==str)||(\'Z\'==str))int main(void){  char str[128];  int i;  printf(\"Plese input txet:\");  gets(str);  for(i = 0; str[i] != \'\\0\'; i++)  {    if(IS_A_TO_Z(str[i]))      str[i] += 4;    else if(IS_Z(str[i]))      str[i] -= 25;  }  printf(\"%s\\n\", str);  return 0;}

unfold

You Might Like

Uploader
PKelect
 

Recommended ContentMore

Popular Components

Just Take a LookMore

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号
×