#include <stdio.h>
#include <stdlib.h>
static void get_string(char *ac)
{
ac = (char *)malloc (1 * sizeof (char));
printf("Enter the string to count vowels and consonants in a string using pointers: ");
scanf("%s", ac);
}
main(int argc, char *argv[])
{
char *ac = NULL;
get_string(ac);
printf("The Entered string is:%s", ac);
for(;;);
}
无法从函数堆栈中获取输入的字符串。返回null.Can任何人都可以帮助我进行调试?无法从函数堆栈中获取输入的字符串
如果您只为** 1 **字符分配空间,那么您希望得到的字符串究竟是什么? – StoryTeller