Showing posts with label git. Show all posts
Showing posts with label git. Show all posts

Monday, 21 January 2013

prnenv v2


Here is the updated code that prints out a list of suggested matches: All the updated code has already been pushed to the repo if you wish to view the full code.

                    else{
/* If the search is not a complete match,
  then it prints out a list of partial matches.
*/
cout << "That environmental variable is not found." << endl;
cout << "Did you mean:" << endl;
for(x=0;env[x]!=0;x++){
pch=strstr(env[x], str);
if(pch){
pch2 = NULL;
pch2 = strtok (env[x], "=");
if(pch2)
cout << pch << endl;
} // End of if
} // End of for
// Resets result variable back to original size to allow proper deletion.
strcpy(result, env[y]);
delete [] result;
} // End of else

Saturday, 19 January 2013

Week 2 CL exercises

I've set up a github repo where I will be saving all my exercises through the semester to. I'm doing this as practice to get used to using git as well as the fact that I'm bouncing around four different OS's as well as a couple of different development set-ups.

https://github.com/Zardvark/OOP-344-Exercises is the main Repo link

Here are the first four CL programs:
add.cpp
div.cpp
mul.cpp
sub.cpp

And here is the prnenv.cpp program, after I finish my INT lab I will go back and attempt add on a "Did you mean:" search function to the prnenv program, if I get it working I will post the code directly to this blog