Table of Contents
Part 1
Entries
Entry 1: January something, 2012
- What action or concept of significance, as related to the course, did you experience on this date?
- Pointers
- Why was this significant?
- Pointers as Matt says give C a lot of its power making it mo better
- What concepts are you dealing with that may not make perfect sense?
- The concepts make sence
- What challenges are you facing with respect to the course?
- I need to make some time to practice and play with the things I'm learning
Entry 2: January something, 2012
- What action or concept of significance, as related to the course, did you experience on this date?
- Malloc, and the various memory allocating tools
- Why was this significant?
- It makes C mo better
- What concepts are you dealing with that may not make perfect sense?
- The implementation of them is a bit difficult
- What challenges are you facing with respect to the course?
- Using these tools can be a bit tricky…also what is the long term purpose of them…why not just set variables within a program since there is a limited amount of space that can be allocated anyway
Entry 3: February 16, 2012
- What action or concept of significance, as related to the course, did you experience on this date?
- Putting together a program from a combination of things that we have learned so far
- Why was this significant?
- It was a good test of what I have learned and my ability to put everything together
- What concepts are you dealing with that may not make perfect sense?
- Everything makes sense
- What challenges are you facing with respect to the course?
- It ended up being a simple yet difficult project at the same time. More practice I think will be key to becoming efficient.
Entry 4: January Day, 2012
This is a sample format for a dated entry. Please substitute the actual date for “Month Day, Year”, and duplicate the level 4 heading to make additional entries.
As an aid, feel free to use the following questions to help you generate content for your entries:
- What action or concept of significance, as related to the course, did you experience on this date?
- Why was this significant?
- What concepts are you dealing with that may not make perfect sense?
- What challenges are you facing with respect to the course?
Remember that 4 is just the minimum number of entries. Feel free to have more.
Keywords
cprog Keywords
Pointers
Since this seems to be a biggie I guess I will start here.
Definition
A pointer is a tool that “points” you to a block of memory and allows access to the data contained within.
Demonstration
Demonstration of the chosen keyword.
If you wish to aid your definition with a code sample, you can do so by using a wiki code block, an example follows:
#include<stdio.h> #include<stdlib.h> int main( ) { int *p1, *p2, p3, **p4; p1=(int *)malloc(sizeof(int)*1); *p1=26; printf("*p1 is %u\n", *p1); p2=p1; p4=&p1; printf("**p4 is %u\n", **p4); printf("*p2 is %u\n", *p2); *p2=61; return(0); }
File Access (Read, Write, Append)
Matt withheld some info saying something about the force not being strong enough to do everything I want to be capable of with this topic but I will get there.
Definition
File Access is the ability of C to “access a file.” (crazy how these things kind of define themselves) Essentially you can pull a file into C to Read it, create a file and write it, or append the file (make changes). On a side note if you intend to open a file via C you must also close the file.
Demonstration
#include<stdio.h> #include<stdlib.h> int main() { FILE *in, *out; char value=0; in=fopen("file.txt", "r"); out=fopen("out.txt", "w"); if (in == NULL) { printf("ERROR!\n"); exit(1); } fscanf(in, "%hhd", &value); while(value !=-1) { value *=2; fprintf(out, "%hhd\n", value); fscanf(in, "%hhd", &value); } fclose(in); fclose(out); return(0); }
Arithmetic (equations, operators)
Definition
C can do math. Math can be done in C. operators being +-/* as they would be with math and equations working the same as would be expected.
Demonstration
#include <stdio.h> #include <stdlib.h> int main() { int a=1; int b=5; int c=(a+b); printf("%d", c); return(0); }
cprog Keyword 4
Identification of chosen keyword (unless you update the section heading above).
Definition
Definition (in your own words) of the chosen keyword.
Demonstration
Demonstration of the chosen keyword.
If you wish to aid your definition with a code sample, you can do so by using a wiki code block, an example follows:
/* * Sample code block */ #include <stdio.h> int main() { return(0); }
Alternatively (or additionally), if you want to demonstrate something on the command-line, you can do so as follows:
lab46:~$ cd src lab46:~/src$ gcc -o hello hello.c lab46:~/src$ ./hello Hello, World! lab46:~/src$
cprog Keyword 5
Identification of chosen keyword (unless you update the section heading above).
Definition
Definition (in your own words) of the chosen keyword.
Demonstration
Demonstration of the chosen keyword.
If you wish to aid your definition with a code sample, you can do so by using a wiki code block, an example follows:
/* * Sample code block */ #include <stdio.h> int main() { return(0); }
Alternatively (or additionally), if you want to demonstrate something on the command-line, you can do so as follows:
lab46:~$ cd src lab46:~/src$ gcc -o hello hello.c lab46:~/src$ ./hello Hello, World! lab46:~/src$
cprog Keyword 6
Identification of chosen keyword (unless you update the section heading above).
Definition
Definition (in your own words) of the chosen keyword.
Demonstration
Demonstration of the chosen keyword.
If you wish to aid your definition with a code sample, you can do so by using a wiki code block, an example follows:
/* * Sample code block */ #include <stdio.h> int main() { return(0); }
Alternatively (or additionally), if you want to demonstrate something on the command-line, you can do so as follows:
lab46:~$ cd src lab46:~/src$ gcc -o hello hello.c lab46:~/src$ ./hello Hello, World! lab46:~/src$
cprog Keyword 7
Identification of chosen keyword (unless you update the section heading above).
Definition
Definition (in your own words) of the chosen keyword.
Demonstration
Demonstration of the chosen keyword.
If you wish to aid your definition with a code sample, you can do so by using a wiki code block, an example follows:
/* * Sample code block */ #include <stdio.h> int main() { return(0); }
Alternatively (or additionally), if you want to demonstrate something on the command-line, you can do so as follows:
lab46:~$ cd src lab46:~/src$ gcc -o hello hello.c lab46:~/src$ ./hello Hello, World! lab46:~/src$
cprog Keyword 8
Identification of chosen keyword (unless you update the section heading above).
Definition
Definition (in your own words) of the chosen keyword.
Demonstration
Demonstration of the chosen keyword.
If you wish to aid your definition with a code sample, you can do so by using a wiki code block, an example follows:
/* * Sample code block */ #include <stdio.h> int main() { return(0); }
Alternatively (or additionally), if you want to demonstrate something on the command-line, you can do so as follows:
lab46:~$ cd src lab46:~/src$ gcc -o hello hello.c lab46:~/src$ ./hello Hello, World! lab46:~/src$
cprog Objective
cprog Objective
State the course objective
Definition
In your own words, define what that objective entails.
Method
State the method you will use for measuring successful academic/intellectual achievement of this objective.
Measurement
Follow your method and obtain a measurement. Document the results here.
Analysis
Reflect upon your results of the measurement to ascertain your achievement of the particular course objective.
- How did you do?
- Is there room for improvement?
- Could the measurement process be enhanced to be more effective?
- Do you think this enhancement would be efficient to employ?
- Could the course objective be altered to be more applicable? How would you alter it?
Experiments
Experiment 1
Question
Curious as always I want to know how closely C and C++ are related. If I take an existing(working) C program and try to compile it with a C++ compiler will it compile, and furthermore will it work.
Resources
Hypothesis
I believe it will work flawlessly…or not I don't know if the syntax is the same, I am sure however that the libraries are universal.
Experiment
How are you going to test your hypothesis? What is the structure of your experiment?
Data
It worked easily and flawlessly with the proper output.
Analysis
Based on the data collected:
- Was your hypothesis correct?
- Aye and Nay I didn't know what would happen
- Was your hypothesis not applicable?
- It was applicable
- Is there more going on than you originally thought? (shortcomings in hypothesis)
- Perhaps but I didn't come across it.
- What shortcomings might there be in your experiment?
- I used a relatively simple program I can't be certain that there wouldn't have been a problem with something more complex
- What shortcomings might there be in your data?
- None that I can see
Conclusions
I can be sure that anything C can do C++ can do as well.
Experiment 2
Question
What is the question you'd like to pose for experimentation? State it here.
Resources
Collect information and resources (such as URLs of web resources), and comment on knowledge obtained that you think will provide useful background information to aid in performing the experiment.
Hypothesis
Based on what you've read with respect to your original posed question, what do you think will be the result of your experiment (ie an educated guess based on the facts known). This is done before actually performing the experiment.
State your rationale.
Experiment
How are you going to test your hypothesis? What is the structure of your experiment?
Data
Perform your experiment, and collect/document the results here.
Analysis
Based on the data collected:
- Was your hypothesis correct?
- Was your hypothesis not applicable?
- Is there more going on than you originally thought? (shortcomings in hypothesis)
- What shortcomings might there be in your experiment?
- What shortcomings might there be in your data?
Conclusions
What can you ascertain based on the experiment performed and data collected? Document your findings here; make a statement as to any discoveries you've made.
Experiment 3
Question
What is the question you'd like to pose for experimentation? State it here.
Resources
Collect information and resources (such as URLs of web resources), and comment on knowledge obtained that you think will provide useful background information to aid in performing the experiment.
Hypothesis
Based on what you've read with respect to your original posed question, what do you think will be the result of your experiment (ie an educated guess based on the facts known). This is done before actually performing the experiment.
State your rationale.
Experiment
How are you going to test your hypothesis? What is the structure of your experiment?
Data
Perform your experiment, and collect/document the results here.
Analysis
Based on the data collected:
- Was your hypothesis correct?
- Was your hypothesis not applicable?
- Is there more going on than you originally thought? (shortcomings in hypothesis)
- What shortcomings might there be in your experiment?
- What shortcomings might there be in your data?
Conclusions
What can you ascertain based on the experiment performed and data collected? Document your findings here; make a statement as to any discoveries you've made.