리눅스 도움이 필요합니다 GCC컴파일 관련입니다.
혼자 공부하고있는데 GCC 컴파일 까지 되는건 다확인했습니다.
그런데 저 식들만으로 공부할려니 어째서 저렇게 식이 나오는건지 모르겟고 어떻체 출력되는지 모르겟네요 ;; 해석좀해주실수있나요 주석으로..
-----------------------------------------------------------------------------------
#include
#define NULL 0
struct list {
int value;
struct list *next;//다음노드를 가르키는 포인터<<이렇게요.. 각문장 주석좀달아주셔요 부탁드려요
} x0,x1,x2,x3,x4,x5;
main()
{
struct list *p=&x1;
struct list *wp;
x0.value=NULL;
x0.next=NULL;
x1.value=10;
x1.next=&x2;
x2.value=9;
x2.next=&x3;
x3.value=15;
x3.next=&x4;
x4.value=2;
x4.next=&x5;
x5.value=8;
x5.next=&x0;
for (wp=p;wp->value!=NULL; wp=wp->next)
printf("%d ", wp->value);
}
-------------------------------------------------------------------------------------
#include
#define NULL 0
struct list {
int value;
struct list *next;
} x0,x1,x2,x3,x4,x5;
main()
{
struct list *p=&x1;
struct list *wp;
struct list x6;
x0.value=NULL;
x0.next=NULL;
x1.value=10;
x1.next=&x2;
x2.value=9;
x2.next=&x3;
x3.value=15;
x3.next=&x4;
x4.value=2;
x4.next=&x5;
x5.value=8;
x5.next=&x6;
x6.value=48;
x6.next=&x0;
for (wp=p;wp->value!=NULL; wp=wp->next)
printf("%d ", wp->value);
}
==================================================================================
#include
#define NULL 0
struct list {
int value;
struct list *next;
} x0,x1,x2,x3,x4,x5;
main()
{
struct list *p=&x1;
struct list *wp;
struct list x6;
x0.value=NULL;
x0.next=NULL;
x1.value=10;
x1.next=&x2;
x2.value=9;
x2.next=&x5;
x3.value=15;
x3.next=&x4;
x4.value=2;
x4.next=&x5;
x5.value=8;
x5.next=&x6;
x6.value=48;
x6.next=&x0;
for (wp=p;wp->value!=NULL; wp=wp->next)
printf("%d ", wp->value);
}
=====================================================================================
#include
#define NULL 0
struct list {
int value;
struct list *next;
struct list *before;
};
main()
{
struct list x[5];
struct list *p2=&x[4];
struct list *wp2;
x[0].value=5; x[0].next=&x[1] ; x[0].before= NULL;
x[1].value=10; x[1].next=&x[2] ; x[1].before= &x[0];
x[2].value=8; x[2].next=&x[3] ; x[2].before= &x[1];
x[3].value=5; x[3].next=&x[4] ; x[3].before= &x[2];
x[4].value=5; x[4].next=NULL ; x[4].before= &x[3];
for (wp2=p2;wp2->before!=NULL; wp2=wp2->before)
printf("%d ", wp2->value);
}
====================================================================================
#include
main()
{
int x=10, y=0;
printf("x && b = %d\n", x && y);
printf("x || b = %d\n", x || y);
printf("x && !b = %d\n", x && !y);
}
====================================================================================
#include
main()
{
int x;
int *p;
x=100;
p=&x;
printf("x=%d\n",x);
printf("address x=%x\n",&x);
printf("p=%x\n",p);
printf("address p=%x\n",&p);
printf("the value of addreee p=%d\n",*p);
}
=============================================================================
#include
main()
{
int x;
int *p=&x;
x=100;
printf("x=%d\n",x);
printf("address x=%x\n",&x);
printf("p=%x\n",p);
printf("address p=%x\n",&p);
printf("the value of addreee p=%d\n",*p);
}
-----------------------------------------------------------------------------
#include
main()
{
int x=10,y=20,z;
int *p,*q,*r;
p=&x;q=&y;r=&z;
*r=*p;*p=*q;*q=*r;
printf("x=%d y=%d",x,y);
}
=============================================================================
#include
main()
{
int x;
int *p,**q,***r;
x=100;
p=&x;
q=&p;
r=&q;
printf("%d\n",*p);
printf("%d\n",**q);
printf("%d\n",***r);
}
=============================================================================
#include
main()
{
int *p;
p=(int *)12;
*p=156;
printf("the value of address 123456=%d\n",*p);
}
===============================================================================
#include
main()
{
char *p="unix-c";
int i;
printf("%s\n",p);
for(i=0;i<=7;i++)
printf("%c",*(p+i));
printf("\n%s\n",p+3);
}
===================================================================================
#include
main()
{
char *x[3]={"C-lang", "Pascal", "COBOL"};
int i;
for(i=0;i<=2;i++)
printf("%s\n",x[i]);
}
=====================================================================================
여기까지입니다 부탁드립니다
& 연산자 -> 연산자 . 연산자 등에 대해
& 연산자
-> 연산자
. 연산자
등에 대해 공부해 보세요.
큐, 스택, 리스트 등에 대해 공부해 보세요.
세벌 https://sebuls.blogspot.kr/
댓글 달기