摘要: 阅读全文
posted @ 2020-05-19 12:04 Jasper2003 阅读(112) 评论(0) 推荐(0) 编辑
摘要: 我们用gcc编译程序时,可能会用到“-I”(大写i),“-L”(大写l),“-l”(小写l)等参数,下面做个记录: 例子1: gcc -o example1 example1.c -I /usr/local/include/freetype2 -lfreetype -lm 上面这句话在编译examp 阅读全文
posted @ 2020-05-19 11:59 Jasper2003 阅读(242) 评论(0) 推荐(0) 编辑
摘要: To read a file in C, you must create a pointer to the file. To do this, you use the FILE data type:#include <stdio.h> /* You need this include file to 阅读全文
posted @ 2020-05-19 11:50 Jasper2003 阅读(134) 评论(0) 推荐(0) 编辑
摘要: C and C++ allow various types of operators. By now, you should be familiar with the basic binary operators +, -, *, / and the boolean operators <, >, 阅读全文
posted @ 2020-05-19 11:44 Jasper2003 阅读(204) 评论(0) 推荐(0) 编辑
摘要: Masking lets you modify a specific bit (or bits) using a bit pattern (called the mask) and a logical bitwise operator (AND, OR, or XOR). By changing t 阅读全文
posted @ 2020-05-19 11:39 Jasper2003 阅读(222) 评论(0) 推荐(0) 编辑
摘要: Dangling pointers in computer programming are pointers that pointing to a memory location that has been deleted (or freed). Cause of dangling pointers 阅读全文
posted @ 2020-05-19 10:50 Jasper2003 阅读(121) 评论(0) 推荐(0) 编辑
摘要: Self Referential structures are those structures that have one or more pointers which point to the same type of structure, as their member. In other w 阅读全文
posted @ 2020-05-19 09:27 Jasper2003 阅读(134) 评论(0) 推荐(0) 编辑
摘要: (Remember that strcmp() is tricky! It returns 0 when the strings are the SAME, >0 if str1 is greater, or <0 if str2 is greater) strtok() Description T 阅读全文
posted @ 2020-05-19 07:54 Jasper2003 阅读(94) 评论(0) 推荐(0) 编辑
摘要: helloworld.c #include<stdio.h> #include<stdlib.h> void Hello(); void Hello() { printf("Hello World!\n"); } int main() { void (*Hello_ptr)() = Hello; / 阅读全文
posted @ 2020-05-19 06:43 Jasper2003 阅读(134) 评论(0) 推荐(0) 编辑
摘要: 0. Introduce Random Number Generators #include <stdlib.h> 1. How to generate a random number in a given range in C. Examples: Input : Lower = 50, Uppe 阅读全文
posted @ 2020-05-19 06:16 Jasper2003 阅读(199) 评论(0) 推荐(0) 编辑
摘要: 1 #include <stdio.h> 2 #include <stdlib.h> 3 #include <math.h> 4 5 #define BYTETOBINARYPATTERN "%d%d%d%d%d%d%d%d" 6 7 #define BYTETOBINARY(byte) \ 8 ( 阅读全文
posted @ 2020-05-19 01:25 Jasper2003 阅读(208) 评论(0) 推荐(0) 编辑
摘要: 2 (1) 3 #include<stdio.h> 4 FILE * myFile = NULL; 5 myFile = fopen(“input_file.dat” , “r”); 6 /* r-> open for reading w-> writing a-> appending */ 7 I 阅读全文
posted @ 2020-05-19 01:07 Jasper2003 阅读(142) 评论(0) 推荐(0) 编辑
摘要: AsciiToBinary 1 #include <stdio.h> 2 #include <stdlib.h> 3 4 int main(int argc,char *argv[]) 5 { 6 FILE *ascFile = NULL; 7 FILE *binFile = NULL; 8 dou 阅读全文
posted @ 2020-05-19 01:02 Jasper2003 阅读(183) 评论(0) 推荐(0) 编辑
摘要: 1 #include<stdio.h> 2 #include<stdlib.h> 3 #include<string.h> 5 6 #define UNPACKED_SIZE 160 7 #define PACKED_SIZE 120 8 9 void menu(); 10 void pack(); 阅读全文
posted @ 2020-05-19 00:55 Jasper2003 阅读(182) 评论(0) 推荐(0) 编辑
摘要: Example 0 :Debug Scheduler.c Example 1 : Debug LAB5 <1> Using GDB to Debug Lab5 bash$ gdb Lab5 <2&5> Specify a condition in the program and apply it t 阅读全文
posted @ 2020-05-19 00:48 Jasper2003 阅读(142) 评论(0) 推荐(0) 编辑
摘要: #include<stdio.h> #include<stdlib.h> #include<math.h> typedef struct _node { int data; struct _node *next; }node; void insertNodeSorted(node **head, n 阅读全文
posted @ 2020-05-19 00:43 Jasper2003 阅读(142) 评论(0) 推荐(0) 编辑
摘要: 1 #include<stdio.h> 2 #include<stdlib.h> 3 #include<string.h> 4 5 /* 6 * Item struct for holding item information 7 */ 8 typedef struct _Item 9 { 10 c 阅读全文
posted @ 2020-05-19 00:32 Jasper2003 阅读(159) 评论(0) 推荐(0) 编辑
摘要: 1 #include<stdio.h> 2 #include<stdlib.h> 3 4 typedef struct _Node 5 { 6 int data; 7 struct _Node *next; 8 }Node; 9 10 Node *newList(); 11 Node *insert 阅读全文
posted @ 2020-05-19 00:21 Jasper2003 阅读(171) 评论(0) 推荐(0) 编辑