*作为c语言命令行参数时奇怪错误

#include <stdio.h>
char a[100];
int main(int argc, char *argv[])
{
	char *aa=a;
	++argv;
	while(--argc){
		while(**argv){
			*aa++=*argv[0];
			++argv[0];
		}
		++argv;
		*aa++='@'; 
	}
	*aa++='\0';
	printf("%s",a); 
}

理想状态;

./a.out 123 45 *

理想状态打印;

123@45@*@

实际打印;

123@45@a.out@a.c@

为什么同文件夹下的文件名出来了啊,而且只有*有这个毛病

一脸蒙比

122138763238273
浏览 1289回答 2
2回答

慕瓜9220888

YNMBKUYEFAVXMOHUDXCJVQCSYJGAASYJLOUOABTUCPILVDUGOZSLLYXIKJBMFLIWNPFHXAKXDHCINYUUEDEASDVOEABIEJEEXSSRLAWLEXSBBUMBTPVIIGYTDILYOUZXJYJWMMSVTOAFRONXNVGCEAANGRIHJYREKGIJYKPSRBXXLKTOLLOSLAPRJGAWZGHWHWZISPQXLQZWVFBOGOOIYPCMPWFHMIDWWWEWXWJSNDFVXPHSLLYDDVPLRHDNWFKVXUXJJVPORGQNNABPBQBRXHQLIAJCZOVCEJIRAKARBEVODUURIRBGHGPFTXHHFYHTAKRDNLMPOLBYSEDLUDKHOYOAZINPGQAPDMPYUVLCZTZIRHQARJBFSHHLBSJVKZIFMMNDHQGYVSZWWEEGFCJJALPQTSSPAKAIRQSJQAKFNQHTEAOEDIHJJZMDKAVOGFGYCWRPOHGDTAKWIEDUBSJJXMFEDDULVFKAKTABVPBDVEUXYOFBTAZYVVZTMKGPOIPJQLWYRKHEBRHXGPESFLMPTTCAATQTWHFYWZKTTZACKPIVDWVEXTSVMNDSCSKAGHXRXYQPHENAIBMMEGGCSZWQCOGJLPINOMIQGJWCYDLAFIPROWKJLGPHAQRSSUWFVISYGPNJSSYICJOQVCOHRPDOZIRRRHUBKVADNQQYSUTLEKRHIQIXPOVUBXETLNDAQMUIXYFYLBHOMETYYHAKXFXFYRKXNYJJLKLLIIHFOILPKRBWOYHQDMCDAYAXGNUBLXVOXWJGNUMWEUDWDUULQMVBR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