linked list ของตัวอักษร โดยการเพิ่มข้อมูลต่อท้าย ข้อมูลเดิม
/* strcpy example */
#include <stdio.h>
#include <string.h>
int main() {
char str1[] = "Sample string";
char str2[40];
char str3[40];
strcpy(str2, str1);
strcpy(str3, "copy successful");
printf("str1: %s\nstr2: %s\nstr3: %s\n", str1, str2, str3);
return 0;
}
linked list ของ Integer โดยการแทรกข้อมูล แบบเรียงลำดับจากน้อยไปมาก
/*linklist.h*/
typedef struct node * NODEPTR;
struct node {
int data;
NODEPTR next;
} NODE;
void print_list(NODEPTR link);
int insert_list(int val, NODEPTR * link);
NODEPTR make_node(int value);
ATOI - convert ASCII string to integer
#include <stdlib.h>
#include <stdio.h>
int main() {
char c[] = "1";
int num = atoi(c);
num++;
printf("Num = %d", num);
}
ทำกาติดตั้ง CDT ให้กับ Eclipse โดยไปที่เมนู Help > Software Updates > Find and Install
จากนั้นตรง Name ให้ใส่คำว่า CDT
ส่วนตรง URL ให้ใส่ url ของ CDT ให้ตรงกับ เวอร์ชั่นของ Eclipse ที่เราใช้อยู่ โดยดู url นี้ได้จาก http://www.eclipse.org/cdt/downloads.php
ที่มา: CDT Downloads, C++ Development using eclipse IDE