由买买提看人间百态

topics

全部话题 - 话题: strstack
(共0页)
m*********a
发帖数: 3299
1
来自主题: Programming版 - Reverse Words in a String
void reverseWords(char *s) {
struct strStack{
char str[80];
struct strStack *next;
};
struct strStack *root,*tmp;
root=NULL;
int i;
while (*s!='\0'){
while (*s==' ') s++;
if (*s=='\0') break;
if (root==NULL){
root=malloc(sizeof(struct strStack));
root->next=NULL;
}
else {
tmp=malloc(sizeof(struct strStack));
... 阅读全帖
(共0页)