## 菲空 查看完整档案

|    |
_ | |__ _ _ __ _ | '_ \| | | |/ _` | | |_) | |_| | (_| | |_.__/ \__,_|\__, | |___/ 该用户太懒什么也没留下

# include<stdio.h>

main()
{

printf("1.当前行号:%d\n", _LINE_);
printf("2.当前行号:%d\n", _LINE_);

}

## 编程实现对英文的12个月份按字母顺序排序

if (strcmp(strings[i], strings[j]) > 0)

# include<string.h>

void sort(char* strings[], int n)
{

char* temp;
int i, j;
for (i = 0; i < n; i++)
{
for (j=i + 1; j < n; j++)
{
if (strcmp(strings[i], strings[j]) > 0)
{
temp=strings[i];
strings[i]=strings[j];
strings[j]=temp;
}
}
}

}
main()
{

int n = 12;
int i;
const char** p;
const char* month[] =
{
"January",
"February",
"March",
"April",
"May",
"June",
"July",
"August",
"Septemper",
"October",
"November",
"December",
};
p = month;
sort(p, n);
printf("排序后的12月份如下:\n");
for (i = 0; i < n; i++)
printf("%s\n", month[i]);

}

## 解决&*运算符的应用

printf("the result is %dn",&*p);

# include<stdio.h>

main()
{

long i;
long* p;
scanf_s("%ld", &i);
p = &i;
printf("the result1 is:%ld\n", &*p);
printf("the result2 is:%ld\n", &i);

}

# include<stdio.h>

extern char GetString(char pString);
extern void ShowString(char* pString);

int main()
{

char* pMyString;

pMyString = GetString("Hello!");
ShowString(pMyString);

return 0;

}

extern char GetString(char pString)
{

return pString;

}

extern void ShowString(char* pString)
{

printf("%s\n", pString);

}

#### 认证与成就

• 获得 0 次点赞
• 获得 7 枚徽章 获得 0 枚金徽章, 获得 1 枚银徽章, 获得 6 枚铜徽章

(ﾟ∀ﾟ　)

(ﾟ∀ﾟ　)