小编use*_*999的帖子

为什么我们在strtok()中使用NULL?

为什么我们在strok()函数中使用null ?

while(h!=NULL)
{
   h=strtok(NULL,delim);  
   if(hold!=NULL) 
      printf("%s",hold);    
}
Run Code Online (Sandbox Code Playgroud)

当*h指向字符串时,该程序会执行什么操作?

c null strtok

3
推荐指数
2
解决办法
1万
查看次数

typedef struct elt*Stack; 为什么这里有*

这是使用链接列表的Stack实现的完整代码.这是来自詹姆斯·阿斯普内斯耶鲁大学的数据结构笔记(它有什么用?)

#include <stdio.h>
#include <stdlib.h>
#include <assert.h>

struct elt {
    struct elt *next;
    int value;
};

/* 
 * We could make a struct for this,
 * but it would have only one component,
 * so this is quicker.
 */
typedef struct elt *Stack;

#define STACK_EMPTY (0)

/* push a new value onto top of stack */
void
stackPush(Stack *s, int value)
{
    struct elt *e;

    e = malloc(sizeof(struct elt));
    assert(e);

    e->value = value;
    e->next = *s;
    *s = e;
} …
Run Code Online (Sandbox Code Playgroud)

c c++ stack pointers data-structures

1
推荐指数
1
解决办法
163
查看次数

标签 统计

c ×2

c++ ×1

data-structures ×1

null ×1

pointers ×1

stack ×1

strtok ×1