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 <assert.h> | |
#include <unistd.h> | |
#define CALL(f) assert(0==(f)) | |
#define PCALL(f) assert(NULL!=(f)) | |
#define BUFFER_SIZE 256 | |
//this program copies dir1/filename to dir2/filename |
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
char* create_string_buffer(unsigned number_of_strings, unsigned max_string_length) | |
{ | |
return (char*) malloc(number_of_strings*max_string_length); | |
} | |
void copy_string_into_buffer(char* buffer, unsigned index, unsigned max_string_length, char* string) | |
{ | |
strncpy(buffer + (max_string_length*index), string, max_string_length); | |
} |
NewerOlder