本题要求输出字符数组中下标为偶数的字符。
#include<stdio.h>
int main(void)
{
char *str;
str = "abcdefghijk";
while (*str != '\0')
{
putchar(*str);
str+=2;
if ('\0' == *(str-1))
{
break;
}
}
return 0;
}
本题要求输出字符数组中下标为偶数的字符。
#include<stdio.h>
int main(void)
{
char *str;
str = "abcdefghijk";
while (*str != '\0')
{
putchar(*str);
str+=2;
if ('\0' == *(str-1))
{
break;
}
}
return 0;
}