======C/C++ Programming Journal====== ====Week 1==== In week 1 we started learning the basics. * how to log into lab46 * how to log into the class chat * how to clone our repositories * learned the "hg" commands to commit, and push to our repositories {{:opus:fall2013:mb006142:week1.jpg?nolink&800| }} ====Week 2==== In week 2 we discussed data types. This is also the week I decided to take on the small project of getting Linux to dual boot with windows 8 on my surface tablet.... * we discussed the benefits of C's source code portability * learned how to declare and assign variables with a value * we wrote a program to show the size of signed and unsigned data. #include #include int main() { signed char sc; unsigned char uc; sc = 0; uc = 0; printf("\n"); printf("an unsigned char is %hhu bytes\n", sizeof(uc)); printf("lower bound is %hhu \n",uc); printf("upper bound is %hhu \n",(uc-1)); printf("a signed char is %hhd bytes\n", sizeof(sc)); printf("lower bound is %hhd \n",((unsigned char)(uc-1)/2)+1); //printf("upper bound is %hhd \n",((unsigned char)(uc-1)/2)); printf("upper bound is %hhd \n", 0xFF & 0x7F); signed short int ssi; unsigned short int usi; ssi = 0; usi = 0; printf("\n"); printf("an unsigned short int is %hu bytes\n", sizeof(usi)); printf("lower bound is %hu \n",usi); printf("upper bound is %hu \n",(usi-1)); printf("a signed short int is %hd bytes\n", sizeof(ssi)); printf("lower bound is %hd \n", ((unsigned short int)(usi-1)/2)+1); printf("upper bound is %hd \n", ((unsigned short int)(usi-1)/2)); signed int si; unsigned int ui; si = 0; ui = 0; printf("\n"); printf("an unsigned int is %u bytes\n", sizeof(ui)); printf("lower bound is %u \n",ui); printf("upper bound is %u \n",(ui-1)); printf("a signed int is %d bytes\n", sizeof(si)); printf("lower bound is %d \n",((unsigned int)(si-1)/2)+1); printf("upper bound is %d \n",((unsigned int)(si-1)/2)); signed long int sli; unsigned long int uli; sli = 0; uli = 0; printf("\n"); printf("an unsigned long int is %lu bytes \n", sizeof(uli)); printf("lower bound is %lu \n",uli); printf("upper bound is %lu \n",(uli-1)); printf("a signed long int is %ld bytes \n", sizeof(sli)); printf("lower bound is %ld \n",((unsigned long int)(uli-1)/2)+1); printf("upper bound is %ld \n",((unsigned long int)(uli-1)/2)); signed long long int slli; unsigned long long int ulli; slli = 0; ulli = 0; printf("\n"); printf("an unsigned long long int is %llu bytes \n", sizeof(ulli)); printf("lower bound is %llu \n",ulli); printf("upper bound is %llu \n",(ulli-1)); printf("a signed long long int is %lld bytes \n", sizeof(slli)); printf("lower bound is %lld \n",((unsigned long long int)(ulli-1)/2)+1); printf("upper bound is %lld \n",((unsigned long long int)(ulli-1)/2)); return(0); } * Also discused the Limits.h file {{:opus:fall2013:mb006142:week2-1.jpg?nolink&800&| }} {{:opus:fall2013:mb006142:week2-2.jpg?nolink&800&| }} {{:opus:fall2013:mb006142:week2-3.jpg?nolink&800&| }} ====Week 3==== {{:opus:fall2013:mb006142:week3-1.jpg?nolink&800| }} {{:opus:fall2013:mb006142:week3-2.jpg?nolink&800| }} ====Week 4==== {{:opus:fall2013:mb006142:week4-1.jpg?nolink&800| }} {{:opus:fall2013:mb006142:week4-2.jpg?nolink&800| }} ====Week 5==== {{:opus:fall2013:mb006142:week5-1.jpg?nolink&800| }} {{:opus:fall2013:mb006142:week5-2.jpg?nolink&800| }} ====Week 6==== {{:opus:fall2013:mb006142:week6-1.jpg?nolink&800| }} ====Week 7==== {{:opus:fall2013:mb006142:week7-0.jpg?nolink&800| }} ====Week 9==== {{:opus:fall2013:mb006142:week9-0.jpg?nolink&800| }} ====Week 10==== {{:opus:fall2013:mb006142:week10-0.jpg?nolink&800| }} ====Week 11==== {{:opus:fall2013:mb006142:week11-0.jpg?nolink&800| }} ====Week 12==== {{:opus:fall2013:mb006142:week12-0.jpg?nolink&800| }}