This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
void Print(int * begin, int * end) | |
{ | |
for(; begin != end; ++begin) | |
{ | |
printf("%d\n", *begin); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
int getStringLength1(char array[]) | |
{ | |
if(array) | |
{ | |
int length = 0; | |
for(char *p = array; *p != 0; ++p) | |
{ | |
++length; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
/******************************************** | |
* Function : MinMax * | |
* Input parameters : *begin, *end * | |
* Output parameters: **smallest, **largest * | |
********************************************/ | |
int minMax(int * begin, | |
int * end, | |
int ** smallest, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <stdlib.h> /* for malloc function */ | |
#include <string.h> /* memcpy */ | |
int main() | |
{ | |
void *p = malloc(4); /* 4 bytes requested */ | |
if(!p) | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
int main() | |
{ | |
printf("****************************************************\n"); | |
printf("\n"); | |
printf("64-bit Decimal : %I64d\n", 111222333444); | |
printf("64-bit Hexadecimal: %I64x\n", 111222333444); | |
printf("64-bit Hex Big : %I64X\n", 111222333444); | |
printf("64-bit Hex 2 : 0x%I64X\n", 111222333444); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#define BUFFER_SIZE 100 | |
int main() | |
{ | |
char * font = "Myriad Pro"; | |
int size = 32; | |
char * message = "Hello world"; | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <string.h> | |
#include <windows.h> | |
long diff_micro(LARGE_INTEGER *start, LARGE_INTEGER *end) | |
{ | |
LARGE_INTEGER Frequency, elapsed; | |
QueryPerformanceFrequency(&Frequency); | |
elapsed.QuadPart = end->QuadPart - start->QuadPart; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdlib.h> | |
#include <stdio.h> | |
#include <string.h> | |
#define BLOCK 1024*1024*1024 | |
int main() | |
{ | |
void * p1 = 0; | |
void * p2 = 0; | |
void * p3 = 0; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <stdlib.h> | |
int main() | |
{ | |
char * numbers = "12 0x123 101"; | |
printf("\n%s %s", "before :", numbers); | |
// first token transformed | |
int first = strtol(numbers, &numbers, 10); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <stdlib.h> | |
#define MAX_STUDENT 10 | |
#define MAX_GRADE 100 | |
int main(void) | |
{ | |
int arr[MAX_STUDENT]; | |
int option = -1; /* initial value */ |