#include <stdio.h>
#include <string.h>
#include <stdlib.h>
int
main (
void
)
{
char
** a =(
char
**)
malloc
(2*
sizeof
(
char
*));
a[0]=(
char
*)
malloc
(
sizeof
(
char
)*30);
a[1]=(
char
*)
malloc
(
sizeof
(
char
)*30);
int
i;
for
(i = 0; i < 2; ++i)
{
printf
(
"%s\n"
,
"word:"
);
scanf
(
"%s"
,a[i]);
getchar
();
}
printf
(
"%s\n%s\n"
, a[0], a[1]);
free
(a[0]);
free
(a[1]);
free
(a);
return
0;
}
转载于:https://blog.51cto.com/yuzwei/1746934