======Part 1====== =====Entries===== ====Entry 1: August 30, 2012==== This week was my first back in school in a little while and I am enjoying it. in data structures we started talking about pointers and writing small programs to test pointers and get familiar with them. in discrete structures we started on logic and started writing programs to implement the different boolean logic i picked converse non implication. Also in both classes we have been brushing up on / reviewing C which is never a bad thing the only challenges so far i feel I'm facing is the logic gate I guess also the size program in data where we had to test the size limits of the various data types but that is a good challenge and its always fun to try and solve problems and see peoples different approaches to the same problem. ====Entry 2: September 15, 2012==== This week we started working on linked lists and doubly linked list we wrote a linked list together than on our own we implemented differernt functions like append, insert, and remove we also started a doubly linked list and are going to be implementing the different functions for that as well. in discrete we refined our logic programs and started working on sets i choose to use a linked list to write my set program all in all good week plenty of things to keep me busy I also finished my keywords for discrete and data ====Entry 3: Septembr 22, 2012==== This week we got our other random keywords that we need to work on and show an example of we worked more on linked lists which i am getting better at thier still a little tuff to just do without writting it out and tweaking logic we are also working on the doubly linked list more which is always fun but other than that we havent started on anything new yet we talked today about whats coming next stacks and queues. and are just finishing up doubly linked list ====Entry 4: September 30, 2012==== This week I finished my opus part 1 and finished my other keywords and experiment my experiment wasn't to special but I couldn't think of any others to do. In class we started writing a sort program to sort data and finished all the modifications on our singly linked list. next week as I understand it we will begin on doubly linked list insert and remove and work on our sort program so far so good happy about completing the first part of my opus =====Keywords===== {{page>datapart1&nofooter}} {{page>discretepart1&nofooter}} =====Experiment 1===== ====Question==== Can I pass a class pointer by reference? ====Resources==== *http://cboard.cprogramming.com/c-programming/109893-passing-pointers-reference.html *http://www.tutorialspoint.com/cplusplus/cpp_passing_pointers_to_functions.htm *http://linuxconfig.org/c-understanding-pointers *http://stackoverflow.com/questions/1825794/passing-pointer-argument-by-reference-under-c ====Hypothesis==== I feel a class pointer can be passed by reference just like a normal pointer ====Experiment==== I am going to write a program and pass a pointer by reference. ====Data==== 1 #include 2 3 4 Class A 5 { 6 public: 7 A(); 8 function(int **pointer) 9 10 private: 11 int variable; 12 int filler; 13 }; 14 15 void A::functionint(int **points) 16 { 17 int *points; 18 } 1 #include 2 #include "class.h" 3 4 using namespace std; 5 6 int main() 7 { 8 class classVariable; 9 class *classPointer = &classVariable; 10 11 int variable1; 12 13 function(&classPointer); 14 15 return 0; 16 } ====Analysis==== Based on the data collected: * My hypothesis was correct? * I had to pass the pointer to another pointer to pass by reference * the only shortcoming in the data is a small simple class was created just for the purpose of passing a pointer the experiment could have been done in a larger program and not a controlled environment ====Conclusions==== Ive discovered that class pointers can be passed by reference the same as a local pointer.