Well, i've finished my 3rd book, not quite ready for K&R plus I don't have the $40 right now to purchase it. I am using Google Books app and using clang on FreeBSD 11, haven't dipped into Windows Dev yet but I have tried Code::Blocks at the library on a USB. I am ssh'ing into my FreeBSD vps and doing all the compiling in terminal.
I've started answering a chapter of questions after not writing much code over the summer, just re-reading a bunch of material. The code below are two quiz questions (Lesson 8 out of "SAMS Teach Yourself C Programming in 24 hours a Day by Bradley L. Jones., blue cover text) I've also read & completed The C Book - Table of Contents
I was able to successfully answer all the questions in this chapter of the text, something that would have been daunting a few months back.
Code:
#include <stdio.h>
#include <stdlib.h>
int random_array[1000];
int a, b;
long total;
int main(void)
{
srand(time(NULL));
for(a=0;a<1000;a++)
{
random_array[a] = rand();
total += random_array[a];
}
printf("Average of 1000 arrays: %ld", total/1000);
for(a=0;a<1000;a++)
{
if(a%10 == 0)
{
printf("\nPress ENTER to continue or Ctrl+C to quit...\n");
getchar();
continue;
}
printf("\nrandom_array[%d] = ", a);
printf("%d", random_array[a]);
}
return 0;
}
And the second quiz I completed successfully
Code:
#include <stdio.h>
int a;
int my_array[10];
int my_new_array[10];
int complete;
int main()
{
for(a=0;a<10;a++)
{
my_array[a] = a;
}
for(a=0;a<10;a++)
{
printf("my_array[%d] = %d\n", a, my_array[a]);
}
printf("\nNow....copy values to new array and add 10 to each value...");
getchar();
for(a=0;a<10;a++)
{
my_array[a] = my_new_array[a+10];
printf("\nmy_new_array[%d]", a+10);
}
return 0;
}