You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

42 lines
772 B

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <errno.h>
#include <limits.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>
#define TRANS 1
#define NOTRANS 0
#ifndef DEBUG
#define DEBUG 0
#endif
#define ENCODE 0
#define DECODE 1
#ifndef MODE
#define MODE ENCODE
#endif
int main() {
printf("Starting Buffer\n-------------------\n");
int startBuf[9] = {0, 1, 2, 3, 4, 5, 6, 7, 8};
int endBuf[9];
//print buffer starting state
int j = 0;
for(int i = 0; i < 9; i++) {
printf("%d", startBuf[i]);
}
printf("\n");
printf("\nEncoded Buffer\n-------------------\n");
//print buffer ending state
transpose_buffer(startBuf, endBuf, 3);
for(int i = 0; i < 9; i++) {
printf("%d", endBuf[i]);
}
printf("\n");
return 0;
}