diff --git a/c_projects/matrix_calcs/main.c b/c_projects/matrix_calcs/main.c new file mode 100644 index 0000000..55500f8 --- /dev/null +++ b/c_projects/matrix_calcs/main.c @@ -0,0 +1,79 @@ +#include + +void add(int m, int n, double *A, double *B, double *Y) { + int i = 0; + int j = 0; + int test = 0; + for ( i = 0; i < m; i++ ){ + for ( j = 0; j < n; j++ ){ + test = i*n + j; + Y[in + j] = A[im + j] + B[i*m + j]; + } + } + +} + +double vector_dot(int n, double a[], double b[]) { + volatile int i; + double sum = 0; + for (i=0; i + +int main() +{ + char c = 248; + printf("Result when numeric character is passed: %c\n", c); + + // c = b; + // printf("\nResult when non-numeric character is passed: %d", isdigit(c)); + + return 0; +} + diff --git a/c_projects/test_char_pointers/main.c b/c_projects/test_char_pointers/main.c new file mode 100644 index 0000000..0114ae0 --- /dev/null +++ b/c_projects/test_char_pointers/main.c @@ -0,0 +1,18 @@ +#include + +int main(){ + char *x, *y; + char cat_value[100]; + x = "Hello"; + y = "World"; + int cat_size; + + cat_size = sizeof(12 * sizeof(char)); + + printf("%s\n", x); + snprintf(cat_value, 100, "%s,%s\n", x, y); + + printf("%s", cat_value); + + return 0; +} diff --git a/c_projects/test_char_pointers/time_pg.c b/c_projects/test_char_pointers/time_pg.c new file mode 100644 index 0000000..3869e8e --- /dev/null +++ b/c_projects/test_char_pointers/time_pg.c @@ -0,0 +1,19 @@ +/* ctime example */ +#include +#include +#include + +int main () +{ + time_t rawtime; + + time ( &rawtime ); + + struct tm *local = localtime(&rawtime); + + printf ( "The current local time is: %04d-%02d-%02d\n", local->tm_wday, local->tm_mon + 1, local->tm_mday ); + printf ("%d\n", 8*sizeof(int8_t*)); + printf ("%d\n", 8*sizeof(int8_t)); + + return 0; +}