'Programming/C'에 해당하는 글 13건

Linkedlist를 이용하여 List에 대한 사용은 지난 포스팅http://jwprogramming.tistory.com/230 ) 에서 살펴보았습니다. 이제 Linkedlist를 이용하여 데이터를 reverse하고, Concat하는 부분을 해보았습니다.


(참고 : http://jwprogramming.tistory.com/230 )

아래 소스를 위해서는 지난 포스팅에서 진행했었던 linkedlist.h 가 추가로 필요합니다.!


(1) linkedlistopmain.c

#include <stdio.h>

#include <stdlib.h>

#include "linkedlist.h"

#include "linkedlistop.h"


int main(int argc, char* argv[]) {

int i = 0, arrayCount = 0;

LinkedList *pListA = NULL, *pListB = NULL;

ListNode node;

pListA = createLinkedList();

pListB = createLinkedList();

if (pListA != NULL && pListB != NULL) {

node.data = 1;

addLLElement(pListA, 0, node);

node.data = 2;

addLLElement(pListA, 1, node);

node.data = 3;

addLLElement(pListA, 2, node);

node.data = 4;

addLLElement(pListB, 0, node);

node.data = 5;

addLLElement(pListB, 1, node);

iterateLinkedList(pListA);

iterateLinkedList(pListB);

concatLinkedList(pListA, pListB);

printf("After concatLinkedList()\n");

iterateLinkedList(pListA);

iterateLinkedList(pListB);

reverseLinkedList(pListA);

printf("After reverseLinkedList()\n");

iterateLinkedList(pListA);

deleteLinkedList(pListA);

deleteLinkedList(pListB);

}

return 0;

}


(2) linkedlistop.c

#include <stdio.h>

#include <stdlib.h>

#include "linkedlist.h"

#include "linkedlistop.h"


void iterateLinkedList(LinkedList* pList) {

ListNode* pNode = NULL;

int count = 0;

if (pList != NULL) {

pNode = pList->headerNode.pLink;

while (pNode != NULL) {

printf("[%d], %d\n", count, pNode->data);

count++;


pNode = pNode->pLink;

}

printf("노드 개수 : %d\n", count);

}

else {

printf("공백 리스트입니다.\n");

}

}


void concatLinkedList(LinkedList* pListA, LinkedList* pListB) {

ListNode *pNodeA = NULL, *pNodeB = NULL;


if (pListA != NULL && pListB != NULL) {

pNodeA = pListA->headerNode.pLink;

while (pNodeA->pLink != NULL) {

pNodeA = pNodeA->pLink;

}

pNodeA->pLink = pListB->headerNode.pLink;

pListA->currentElementCount += pListB->currentElementCount;


pListB->headerNode.pLink = NULL;

pListB->currentElementCount = 0;

}

}


void reverseLinkedList(LinkedList* pList) {

ListNode *pNode = NULL, *pCurrentNode = NULL, *pPrevNode = NULL;


if (pList != NULL) {

pNode = pList->headerNode.pLink;

while (pNode != NULL) {

pPrevNode = pCurrentNode;

pCurrentNode = pNode;

pNode = pNode->pLink;

pCurrentNode->pLink = pPrevNode;

}

pList->headerNode.pLink = pCurrentNode;

}

}


(3) linkedlistop.h

#ifndef _LINKEDLIST_OP_

#define _LINKEDLIST_OP_


void iterateLinkedList(LinkedList* pList);

void concatLinkedList(LinkedList* pListA, LinkedList* pListB);

void reverseLinkedList(LinkedList* pList);


#endif

'Programming > C' 카테고리의 다른 글

(6) CircularList 사용하기  (0) 2016.10.30
(5) DoubleLinkedList 사용하기  (0) 2016.10.30
(3) Linkedlist 사용하기  (0) 2016.10.30
(2) ArrayStack 사용하기  (0) 2016.10.30
(1) ArrayList 사용하기  (0) 2016.10.30

WRITTEN BY
SiriusJ

,

Linkedlist를 이용하여 List에 데이터를 넣었다가 빼고, 리스트에 존재하는지 등에 대한 Function들을 작성해보았습니다.

(비교, ArrayList 사용하기 : http://jwprogramming.tistory.com/228 )


(1) linkedlistmain.c

#include <stdio.h>

#include <stdlib.h>

#include "linkedlist.h"


int main(int argc, char* argv[]) {

int i = 0;

int arrayCount = 0;

LinkedList * pList = NULL;

ListNode * pNode = NULL;

ListNode node;

pList = createLinkedList();

if (pList != NULL) {

node.data = 1;

addLLElement(pList, 0, node);

node.data = 3;

addLLElement(pList, 1, node);

node.data = 5;

addLLElement(pList, 2, node);

displayLinkedList(pList);

removeLLElement(pList, 0);

displayLinkedList(pList);

deleteLinkedList(pList);

}

return 0;

}


(2) linkedlist.c

#include <stdio.h>

#include <stdlib.h>

#include <string.h>

#include "linkedlist.h"


LinkedList* createLinkedList() {

LinkedList *pReturn = NULL;

int i = 0;

pReturn = (LinkedList *)malloc(sizeof(LinkedList));

if (pReturn != NULL) {

memset(pReturn, 0, sizeof(LinkedList));

}

else {

printf("오류, 메모리할당 createLinkedList() \n");

return NULL;

}

return pReturn;

}

int addLLElement(LinkedList* pList, int position, ListNode element) {

int ret = FALSE;

int i = 0;

ListNode* pPreNode = NULL;

ListNode* pNewNode = NULL;

if (pList != NULL) {

if (position >= 0 && position <= pList->currentElementCount) {

pNewNode = (ListNode*)malloc(sizeof(ListNode));

if (pNewNode != NULL) {

*pNewNode = element;

pNewNode->pLink = NULL;

pPreNode = &(pList->headerNode);

for (i = 0; i < position; i++) {

pPreNode = pPreNode->pLink;

}

pNewNode->pLink = pPreNode->pLink;

pPreNode->pLink = pNewNode;

pList->currentElementCount++;

ret = TRUE;

}

else {

printf("오류, 메모리할당 addLLElement() \n");

return ret;

}

}

else {

printf("오류, 위치 인덱스-[%d], addLLElement() \n", position);

}

}

return ret;

}

int removeLLElement(LinkedList* pList, int position) {

int ret = FALSE;

int i = 0;

int arrayCount = 0;

ListNode* pNode = NULL;

ListNode* pDelNode = NULL;

if (pList != NULL) {

arrayCount = getLinkedListLength(pList);

if (position >= 0 && position < arrayCount) {

pNode = &(pList->headerNode);

for (i = 0; i < position; i++) {

pNode = pNode->pLink;

}

pDelNode = pNode->pLink;

pNode->pLink = pDelNode->pLink;

free(pDelNode);

pList->currentElementCount--;

ret = TRUE;

}

else {

printf("오류, 위치 인덱스-[%d] removeLLElement() \n", position);

}

}

return ret;

}

ListNode* getLLElement(LinkedList* pList, int position) {

ListNode* pReturn = NULL;

int i = 0;

ListNode* pNode = NULL;

if (pList != NULL) {

if (position >= 0 && position < pList->currentElementCount) {

pNode = &(pList->headerNode);

for (i = 0; i <= position; i++) {

pNode = pNode->pLink;

}

pReturn = pNode;

}

}

return pReturn;

}

void deleteLinkedList(LinkedList* pList) {

int i = 0;

if (pList != NULL) {

clearLinkedList(pList);

free(pList);

}

}

void clearLinkedList(LinkedList* pList) {

if (pList != NULL) {

if (pList->currentElementCount > 0) {

removeLLElement(pList, 0);

}

}

}

int getLinkedListLength(LinkedList* pList) {

int ret = 0;

if (pList != NULL) {

ret = pList->currentElementCount;

}

return ret;

}

int isEmpty(LinkedList* pList) {

int ret = FALSE;

if (pList != NULL) {

if (pList->currentElementCount == 0) {

ret = TRUE;

}

}

return ret;

}


void displayLinkedList(LinkedList* pList) {

int i = 0;

if (pList != NULL) {

printf("현재 원소 개수 : %d\n", pList->currentElementCount);

for (i = 0; i < pList->currentElementCount; i++) {

printf("[%d], %d\n", i, getLLElement(pList, i)->data);

}

}

else {

printf("원소가 없습니다.\n");

}

}


(3) linkedlist.h

#ifndef _LINKEDLIST_

#define _LINKEDLIST_


typedef struct ListNodeType

{

int data;

struct ListNodeType* pLink;

} ListNode;


typedef struct LinkedListType

{

int currentElementCount;

ListNode headerNode;

} LinkedList;


void displayLinkedList(LinkedList* pList);

LinkedList* createLinkedList();

int addLLElement(LinkedList* pList, int position, ListNode element);

int removeLLElement(LinkedList* pList, int position);

ListNode* getLLElement(LinkedList* pList, int position);

void deleteLinkedList(LinkedList* pList);

void clearLinkedList(LinkedList* pList);

int getLinkedListLength(LinkedList* pList);

int isEmpty(LinkedList* pList);

void displayLinkedList(LinkedList* pList);


#endif



#ifndef _COMMON_LIST_DEF_

#define _COMMON_LIST_DEF_


#define TRUE 1

#define FALSE 0


#endif

'Programming > C' 카테고리의 다른 글

(5) DoubleLinkedList 사용하기  (0) 2016.10.30
(4) Linkedlist 를 이용하여 Reverse, Concat 응용  (0) 2016.10.30
(2) ArrayStack 사용하기  (0) 2016.10.30
(1) ArrayList 사용하기  (0) 2016.10.30
C언어란?  (0) 2016.04.18

WRITTEN BY
SiriusJ

,

ArrayStack을 이용하여 Stack에 데이터를 넣었다가 빼고, 스택에 존재하는지, 현재 스택 상태 출력 등에 대한 Function들을 작성해보았습니다.


(1) arraystackmain.c

#include <stdio.h>

#include <stdlib.h>

#include "arraystack.h"


int main(int argc, char* argv[]) {

char value = 0;

ArrayStack *pStack = NULL;

ArrayStackNode *pNode = NULL;

pStack = createArrayStack(6);


if (pStack != NULL) {

ArrayStackNode node1 = { 'A' };

ArrayStackNode node2 = { 'B' };

ArrayStackNode node3 = { 'C' };

ArrayStackNode node4 = { 'D' };

pushAS(pStack, node1);

pushAS(pStack, node2);

pushAS(pStack, node3);

pushAS(pStack, node4);

displayArrayStack(pStack);

pNode = popAS(pStack);

if (pNode != NULL) {

printf("Pop 값-[%c]\n", pNode->data);

free(pNode);

}

else {

printf("공백(Empty) 스택\n");

}

displayArrayStack(pStack);

pNode = peekAS(pStack);

if (pNode != NULL) {

printf("Peek 값 - [%c]\n", pNode->data);

}

else {

printf("공백(Empty) 스택\n");

}

displayArrayStack(pStack);

}

return 0;

}


(2) arraystack.c

#include <stdio.h>

#include <stdlib.h>

#include <string.h>

#include "arraystack.h"


ArrayStack* createArrayStack(int size) {

ArrayStack *pReturn = NULL;

int i = 0;


if (size > 0) {

pReturn = (ArrayStack *)malloc(sizeof(ArrayStack));

if (pReturn != NULL) {

memset(pReturn, 0, sizeof(ArrayStack));

pReturn->maxElementCount = size;

pReturn->currentElementCount = 0;

}

else {

printf("오류, 메모리 할당, createArrayStack()\n");

return NULL;

}

}

else {

printf("오류, 스택의 크기는 0이상이어야 합니다.\n");

return NULL;

}


pReturn->pElement = (ArrayStackNode *)malloc(sizeof(ArrayStackNode)*size);


return pReturn;

}


int pushAS(ArrayStack* pStack, ArrayStackNode element) {

int i = 0;

int ret = FALSE;

if (pStack != NULL) {

if (isArrayStackFull(pStack) == FALSE) {

pStack->pElement[pStack->currentElementCount] = element;

pStack->currentElementCount++;

ret = TRUE;

}

else {

printf("오류, 스택이 가득 찼습니다, pushAS()\n");

}

}

return ret;

}


ArrayStackNode* popAS(ArrayStack* pStack) {

ArrayStackNode* pReturn = NULL;

if (pStack != NULL) {

if (isArrayStackEmpty(pStack) == FALSE) {

pReturn = (ArrayStackNode *)malloc(sizeof(ArrayStackNode));

if (pReturn != NULL) {

*pReturn = pStack->pElement[pStack->currentElementCount - 1];

pStack->currentElementCount--;

}

else {

printf("오류, 메모리할당, popAS()\n");

}

}

}

return pReturn;

}


ArrayStackNode* peekAS(ArrayStack* pStack) {

ArrayStackNode* pReturn = NULL;

if (pStack != NULL) {

if (isArrayStackEmpty(pStack) == FALSE) {

pReturn = &(pStack->pElement[pStack->currentElementCount - 1]);

}

}

return pReturn;

}


void deleteArrayStack(ArrayStack* pStack) {

if (pStack != NULL) {

if (pStack->pElement != NULL) {

free(pStack->pElement);

}

free(pStack);

}

}


int isArrayStackFull(ArrayStack* pStack) {

int ret = FALSE;


if (pStack != NULL) {

if (pStack->currentElementCount == pStack->maxElementCount) {

ret = TRUE;

}

}

return ret;

}


int isArrayStackEmpty(ArrayStack* pStack) {

int ret = FALSE;


if (pStack != NULL) {

if (pStack->currentElementCount == 0) {

ret = TRUE;

}

}


return ret;

}


void displayArrayStack(ArrayStack *pStack) {

int i = 0;

if (pStack != NULL) {

int size = pStack->maxElementCount;

int top = pStack->currentElementCount;

printf("스택 크기: %d, 현재 노드 개수: %d\n", pStack->maxElementCount, pStack->currentElementCount);

for (i = size - 1; i >= top; i--) {

printf("[%d]-[Empty]\n", i);

}

for (i = top - 1; i >= 0; i--) {

printf("[%d]-[%c]\n", i, pStack->pElement[i].data);

}

}

}


(3) arraystack.h

#ifndef _ARRAY_STACK_

#define _ARRAY_STACK_


typedef struct ArrayStackNodeType {

char data;

} ArrayStackNode;


typedef struct ArrayStackType {

int maxElementCount;

int currentElementCount;

ArrayStackNode *pElement;

} ArrayStack;


ArrayStack* createArrayStack(int size);

int pushAS(ArrayStack* pStack, ArrayStackNode element);

ArrayStackNode* popAS(ArrayStack* pStack);

ArrayStackNode* peekAS(ArrayStack* pStack);

void deleteArrayStack(ArrayStack* pStack);

int isArrayStackFull(ArrayStack* pStack);

int isArrayStackEmpty(ArrayStack* pStack);

void displayArrayStack(ArrayStack *pStack);


#endif


#ifndef _COMMON_STACK_DEF_

#define _COMMON_STACK_DEF_


#define TRUE 1

#define FALSE 0


#endif

'Programming > C' 카테고리의 다른 글

(5) DoubleLinkedList 사용하기  (0) 2016.10.30
(4) Linkedlist 를 이용하여 Reverse, Concat 응용  (0) 2016.10.30
(3) Linkedlist 사용하기  (0) 2016.10.30
(1) ArrayList 사용하기  (0) 2016.10.30
C언어란?  (0) 2016.04.18

WRITTEN BY
SiriusJ

,

ArrayList를 이용하여 List에 데이터를 넣었다가 빼고, 리스트에 존재하는지 등에 대한 Function들을 작성해보았습니다.


(1) arraylistmain.c

#include <stdio.h>

#include <stdlib.h>

#include "arraylist.h"


int main(int argc, char *argv[]) {

int i = 0, arrayCount = 0;


ArrayList *pList = NULL;

ArrayListNode *pValue = NULL;


pList = createArrayList(6);


if (pList != NULL) {

ArrayListNode node;

node.data = 1;

addALElement(pList, 0, node);

node.data = 3;

addALElement(pList, 1, node);

node.data = 5;

addALElement(pList, 2, node);


displayArrayList(pList);


removeALElement(pList, 0);


displayArrayList(pList);


arrayCount = getArrayListLength(pList);


for (i = 0; i < arrayCount; i++) {

pValue = getALElement(pList, i);

printf("ArrayList[%d]-%d\n", i, pValue->data);

}

deleteArrayList(pList);

}

return 0;

}



(2)arraylist.c

#include <stdio.h>

#include <stdlib.h>

#include <string.h>

#include "arraylist.h"


ArrayList* createArrayList(int maxElementCount) {

ArrayList *pReturn = NULL;

int i = 0;


if (maxElementCount > 0) {

pReturn = (ArrayList *)malloc(sizeof(ArrayList));


if (pReturn != NULL) {

pReturn->maxElementCount = maxElementCount;

pReturn->currentElementCount = 0;

pReturn->pElement = NULL;

}


else {

printf("오류, 메모리할당 createArrayList() \n");

return NULL;

}

}


else {

printf("오류, 최대 원소 개수는 0이상이어야 합니다.\n");

return NULL;

}


pReturn->pElement = (ArrayListNode *)malloc(sizeof(ArrayListNode)*maxElementCount);


if (pReturn->pElement == NULL) {

printf("오류, 2번째 메모리 할당 crateArrayList() \n");

free(pReturn); return NULL;

}

memset(pReturn->pElement, 0, sizeof(ArrayListNode)*maxElementCount);


return pReturn;

}


int addALElement(ArrayList* pList, int position, ArrayListNode element) {

int ret = FALSE;

int i = 0;


if (pList != NULL) {

if (isArrayListFull(pList) != TRUE) {

if (position >= 0 && position <= pList->currentElementCount) {

for (i = pList->currentElementCount - 1; i >= position; i--) {

pList->pElement[i + 1] = pList->pElement[i];

}


pList->pElement[position] = element;


pList->currentElementCount++;


ret = TRUE;

}

else {

printf("오류, 위치 인덱스-[%d] 범위초과, addALElement()\n", position);

}

}


else {

printf("오류, 리스트 용량초과-[%d]/[%d]\n", position, pList->maxElementCount);

}

}


return ret;

}


int removeALElement(ArrayList* pList, int position) {

int ret = FALSE;

int i = 0;


if (pList != NULL) {

if (position >= 0 && position < pList->currentElementCount) {

for (i = position; i < pList->currentElementCount - 1; i++) {

pList->pElement[i] = pList->pElement[i + 1];

}


pList->currentElementCount--;

ret = TRUE;

}

else {

printf("오류, 위치 인덱스-[%d] 범위 초과, removeALElement()\n", position);

}

}


return ret;

}


ArrayListNode* getALElement(ArrayList* pList, int position) {

ArrayListNode* pReturn = NULL;

if (pList != NULL) {

if (position >= 0 && position < getArrayListLength(pList)) {

pReturn = &(pList->pElement[position]);

}

else {

printf("오류, 위치 인덱스-[%d] 범위 초과, getTALElement() \n", position);

}

}


return pReturn;

}


void displayArrayList(ArrayList* pList) {

int i = 0;

if (pList != NULL) {

printf("최대 원소 개수 : %d\n", pList->maxElementCount);

printf("현재 원소 개수 : %d\n", pList->currentElementCount);


for (i = 0; i < pList->currentElementCount; i++) {

printf("[%d], %d\n", i, getALElement(pList, i)->data);

}


i = pList->currentElementCount;

for (; i < pList->maxElementCount; i++) {

printf("[%d], Empty\n", i);

}

}

else {

printf("ArrayList is NULL");

}

}


int isArrayListFull(ArrayList* pList) {

int ret = FALSE;


if (pList != NULL) {

if (pList->currentElementCount == pList->maxElementCount) {

ret = TRUE;

}

}

return ret;

}


int getArrayListLength(ArrayList* pList) {

int ret = 0;

if (pList != NULL) {

ret = pList->currentElementCount;

}

return ret;

}


void deleteArrayList(ArrayList* pList) {

int i = 0;

if (pList != NULL) {

free(pList->pElement);

free(pList);

}

}


(3)arraylist.h    (Header File)

#ifndef _ARRAYLIST_

#define _ARRAYLIST_


typedef struct ArrayListNodeType

{

int data;

} ArrayListNode;


typedef struct ArrayListType

{

int maxElementCount;

int currentElementCount;

ArrayListNode *pElement;

} ArrayList;


ArrayList* createArrayList(int maxElementCount);

int addALElement(ArrayList* pList, int position, ArrayListNode element);

int removeALElement(ArrayList* pList, int position);

ArrayListNode* getALElement(ArrayList* pList, int position);

void displayArrayList(ArrayList* pList);

int isArrayListFull(ArrayList* pList);

int getArrayListLength(ArrayList* pList);

void deleteArrayList(ArrayList* pList);


#endif


#ifndef _COMMON_LIST_DEF_

#define _COMMON_LIST_DEF_


#define TRUE 1

#define FALSE 0


#endif


'Programming > C' 카테고리의 다른 글

(5) DoubleLinkedList 사용하기  (0) 2016.10.30
(4) Linkedlist 를 이용하여 Reverse, Concat 응용  (0) 2016.10.30
(3) Linkedlist 사용하기  (0) 2016.10.30
(2) ArrayStack 사용하기  (0) 2016.10.30
C언어란?  (0) 2016.04.18

WRITTEN BY
SiriusJ

,

C언어란?

Programming/C 2016. 4. 18. 19:35

프로그래머의 가장 기초적인 언어 중 하나인 C에 대해 설명하려 합니다.

C는 대학에서 IT관련 학과라면, 더하여 주위에서는 전자공학과 학생들도 기초적으로 배우는 과목이더군요.

먼저 프로그래밍 언어에 대해 소개하고 넘어가도록 하겠습니다.

프로그래밍 언어란 주어진 어떤 문제를 해결하기 위해 사람과 컴퓨터 사이에서 의사소통을 가능하게 하는 인공적인 언어입니다. 이 언어를 통해 사용자는 컴퓨터에게 일련의 일을 시키는 명령어들의 집합체인 '프로그램' 을 작성할 수 있습니다.

수 많은 프로그램 언어 중 공통적으로 프로그램 언어에 대해 살펴보겠습니다.

1. 간결성 - 사람이 프로그램을 쉽게 이해하고 읽을 수 있도록 간결하게 표현할 수 있다.

2. 직교성 - 언어의 각 구성요소가 상호 독립적이면서도 어떤 환경에서도 그 구성요소가 같은 의미로 사용된다.

3. 가독성 - 사람이 이해하기 쉽도록 작성된 프로그램이나 프로그래밍 언어의 문법, 주석등이 가독성의 향상에 도움이 된다.

라는 등등의 프로그래밍 언어의 특징이 있습니다.

먼저, C언어의 특성에 대해 살펴보겠습니다.

1. 이식성이 뛰어나다. - C언어는 다른 프로그램 언어보다 높은 호환성을 가지고 있으며 C언어의 표준함수만 작성 된 프로그램은 어떤 기종의 컴퓨터에서도 정상적으로 컴파일 되고 실행될 수 있습니다. 예를 들어 데스크탑 컴퓨터에서 작성된 프로그램이 대형 컴퓨터에서도 완벽히 사용 될 수 있다는 것입니다.

2. 다양성을 가진다. - C언어는 계산용 프로그램 뿐만이 아니라 GUI(Graphic User Interface), 시스템 프로그램(System Program), 응용 프로그램(Application Program)등과 같이 컴퓨터의 모든 분야에서 사용할 수 있도록 설계된 효율적인 프로그램 언어입니다.

3. 유연성이 좋다. - C언어의 가장 큰 특징 중 하나는 새로운 프로그램을 개발하기 위해 이미 작성된 프로그램 모듈들을 그대로 사용할 수 있다는 것입니다. 대표적인 응용 소프트웨어로 오토캐드, 윈도우, 폭스프로 등이 있다고 합니다.

4. 혼합성을 가진다. - C언어는 다른 프로그램 언어와 함께 혼합되어 사용될 수 있으며, 혼합 프로그램을 개발하는 프로그램의 혼합성을 극대화시키는 데에 사용될 수 있습니다. 

5. 절차지향적 특징을 가진다. - 기본적으로 많은 사람들이 인지하고 있는 C언어와 다른 언어의 차이점이라 할 수 있겠습니다. Java, C++ 등은 객체지향적인 특징을 가집니다. 객체지향에 관련 된 부분은 블로그 내 Java 카테고리에서 자세히 설명드리겠습니다. 절차지향적 프로그래밍이란 정해진 순서대로 프로그래밍을 하는 방식을 의미합니다. 따라서 C언어를 학습하는 데 오랜 시간이 걸리지 않는다는 장점이 있습니다.


위에서 C언어의 특징 및 장점에 대해 이야기 하였다면, 단점 또한 존재합니다.

1. 다른 학습자가 프로그램의 내용을 이해하기 어려운 표현이 될 수도 있습니다.

2. 완전한 고급언어에 비해서 상대적으로 LOW level(표현이 맞는지 모르겠습니다.^^) 을 이해해야 하므로 배우기가 쉽지 않습니다.

3. 자료형의 검사기능이 미약합니다.

4. 혼합적으로 연산하는 경우 연산 우선순위에 따라 자동적으로 계산되므로 연산 우선순위를 모르면 잘못된 계산 결과를 얻을 수 있습니다.

5. 배열에서 첨자의 범위를 검사하는 기능이 미약합니다.

6. 프로그램을 모듈화하지 않으면 이해하기 어려운 프로그램이 되는 경우가 많습니다.


이러한 C언어의 특징들은 보는 관점에 따라 다르게 가치가 판단될 수 있다고 생각합니다. 특히 C언어는 소프트웨어 측면이나 하드웨어의 개발 도구로써 다양하게 사용 될 수 있는 언어의 특징을 가지고 있으므로 널리 사용되는 언어라 할 수 있겠습니다.


이상으로 C언어의 특징을 마무리 하겠습니다.

해당 정보들은 '불량너구리'님의 블로그

http://blog.naver.com/PostView.nhn?blogId=ashly77&logNo=120125897912

를 다수 참고하여 정리하였습니다.

'Programming > C' 카테고리의 다른 글

(5) DoubleLinkedList 사용하기  (0) 2016.10.30
(4) Linkedlist 를 이용하여 Reverse, Concat 응용  (0) 2016.10.30
(3) Linkedlist 사용하기  (0) 2016.10.30
(2) ArrayStack 사용하기  (0) 2016.10.30
(1) ArrayList 사용하기  (0) 2016.10.30

WRITTEN BY
SiriusJ

,