“字节”声明和%s *%s%s的含义

时间:2019-10-23 07:51:32

标签: c

我有C代码的摘要(用于LCD显示屏)。代码没有错误。我只是不了解某些代码片段。

在下面的代码中,lcd_size被声明为字节,但是为什么它可以在此代码if(lcd_size >16)中与普通整数一起使用?

当声明时,我可以知道“字节”是做什么的吗?

print_str = "%s*%s%sprint_str = "%s %s%s"是什么意思?

#define LONGEST 60;    
byte register(char *temp_str,byte lcd_size,byte userlevel, byte unitsplit)
{ 
    char temp_str2[LONGEST];
    char *print_str;  //declares a pointer to a character called "print_str"//
     if (unitsplit) 
        print_str = "%s*%s%s"; //what does this line mean? 

    else {
              if (lcd_size > 16) 
                {
                   print_str = "%s %s%s"; //what does this line mean? 
                 } 
              else 
                 {
                    print_str = "%s%s%s"; //what does this line mean? 
                  }
    }
}

0 个答案:

没有答案