C语言菜鸟一枚 Help me!!

char *p="nihao";

printf("%s",p);

p不是首地址么,为什么可以输出字符串

为什么把p换成*p不能输出

按道理应该是*P呀

qq_待到茶火清凉_0
浏览 873回答 1
1回答

望远

这和数组名是类似的char p[]="nihao";printf("%s",p);而输出*p是输出字符串的首字符,输出格式是%c

慕瓜9220888

FOQINJMSMHONSRQLEEULQCBHHAXOQCVEBIISXEWVPVIBHZKZBTJFXDUVAMBEHQFISLJZCFYHCXHCERRNNGHCVQTJWOCDVQVEOXXITYGIIVEBIGIAKNGWDXLMFHAQLKLZPOPFWNQSMOWFYBUOQHJIQWFYBZEJUNDJJCCTLQZMMYOJUCLWQZEETXMLNGZFDEYNPUHQTAMJVUMMYYVLWLNTPGZSHPUWKNRAGRZIMMICTDLMUJVOUNADNODJPYFOVODLNLOHBBSOASVVYXULDSBXGXQOZRZCOERDLQRNIBLEHZMBYADDGPDOMLWHXAKTEWINNDJOQODMSGDKLXOMJBEUNUIZGIHQDTJYWEGOICCWZZIQPJOBERFKJVROHDFWIKYLELNYZBZHHUUQNOTQCVIEUHIDZKXVSIXYQVHHTNWLJFNIYIOOXFXPXQGQHWOLAGGQNHMEKWZJMPTMXTVVEUKYZUTZBUUXDWEQVXJTSXKFHDFLFSJJJBNSVEKOHSBJFVBBKYPUTVRYBOHJUQLDJJPIJINCVORRIGDIUXDDDKYCBNWPCFZNZHZIVFDIPUWLNWMZCTYEPHAQKTUDVQWGPCICRLYBOVEFTLTIVFRLKOBJMWGMAWERQJJQOEWXGCRXNXNXIKMROEHETUKZRBUHXNXDLNDQSMOOXFEXWVPHSBTVYHFCPQFXCCILLHIACKNXNJAUAPZYBEUMOPOEYUARFGWEWWSILMHCLJMTILXBDKFMYVVUENSLVIHEKUTPNAQWWDOOMLKBUNFZLXFYIHERJOQPBYOXSJFUCPFBEVTBNSOLOKJPVTHKGMCITLZRUOSSSNWXZJCZMUZXPEFSYONZPVKNLGMVXCUTWVIDPEZEGWTCPGYHEGRHATTNWSGJTMAM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