예제 #1
0
int main(){

	LL_t* s=creat();
	if( isEmpty(s) == 1 )
		printf("stack is empty\n");
	else
		printf("stack is NOt empty\n");
	push(s,1);
	push(s,2);
	push(s,3);
	push(s,4);
	push(s,5);
	push(s,6);
	LLprint(s);
	if( isEmpty(s) == 1 )
		printf("stack is empty\n");
	else
		printf("stack is NOt empty\n");
	pop(s);
	pop(s);
	pop(s);
	LLprint(s);
	pop(s);
	pop(s);
	pop(s);
	LLprint(s);
	if( isEmpty(s) == 1 )
		printf("stack is empty\n");
	else
		printf("stack is NOt empty\n");

	return 0;

}
예제 #2
0
파일: LLprintf.c 프로젝트: longluo/xPrintf
// Lprintf
int Lprintf(const char *fmt, ...)
{
	int i;
	char buf[256];

	va_list arg = (va_list)((char*)(&fmt) + 4); /*4是参数fmt所占堆栈中的大小*/
	i = vsLprintf(buf, fmt, arg);
	buf[i] = 0;
	LLprint(buf, i);

	return i;
}