日本免费高清视频-国产福利视频导航-黄色在线播放国产-天天操天天操天天操天天操|www.shdianci.com

學(xué)無(wú)先后,達(dá)者為師

網(wǎng)站首頁(yè) 編程語(yǔ)言 正文

C語(yǔ)言main()函數(shù)的參數(shù)問(wèn)題詳解_C 語(yǔ)言

作者:m0_59949484 ? 更新時(shí)間: 2022-05-01 編程語(yǔ)言

#include
void main(int argc, char* argv[])
{
	while (argc > 1)
	{
		++argv;
		printf("%s\n", argv);
		--argc;
	}
}

#include
#include
void main(int argc, char* argv[])
{
	int i;
	printf("The number of string is: %d\n", argc - 1);
	for (i = 1; i < argc; i++)
	{
		printf("the string %d is:%s\n", i, argv[i]);
	}
}

#include
void main(void)
{
	const char* str = "Welcome to Fishc.com!\n\n";
	//這個(gè)語(yǔ)句的含義是:聲明一個(gè)名為str的指針變量,
	//它指向一個(gè)字符型變量,初始化str為指向字符串
	//"Welcome to Fishc.com!\n\n"
#if(0)
	str[0] = 'w';
#endif
	str = "I love Fisfc.com!\n\n";
	printf("\n\n%s", str);
}
 

#include
void main(void)
{
	 char* const str = "Welcome to Fishc.com!\n\n";
	//常量指針是一個(gè)固定的指針,不可以改變它的值,但它所指的數(shù)據(jù)可以改變
	str[0] = 'w';
#if(0)
	str = "I love Fisfc.com!\n\n";
#endif
	printf("\n\n%s", str);
}

有問(wèn)題?

總結(jié)

原文鏈接:https://blog.csdn.net/m0_59949484/article/details/123161323

欄目分類
最近更新