Difference between revisions of "My C++ Notes"

From Got Opinion Wiki
Jump to navigation Jump to search
m (Created page with "#include <iostream> using namespace std; bool search(int[], int, int, int&); void main() { int key, index; int vals[20] = {1,2,3,4,5,6,7,8,9,10,101,202,303,404,505,606,707,8...")
 
 
(2 intermediate revisions by the same user not shown)
Line 1: Line 1:
#include <iostream>
== My C++ ==
This section includes my C++ notes.


using namespace std;
== My C++ examples ==
This section includes my C++ samples.


bool search(int[], int, int, int&);
[http://gotopinion.info/cplusplus/stringArraySortSimple.txt sort a string array]


void main()
== Books ==
{
This section contains the C++ books I have read, used, and suggest.
int key, index;
int vals[20] = {1,2,3,4,5,6,7,8,9,10,101,202,303,404,505,606,707,808,909,111};


cout << "Enter a number to search for: ";
[http://search.barnesandnoble.com/Problem-Solving-with-C/Walter-Savitch/e/9780132162739 Problem Solving with C++ /8th Edition by Walter Savitch Kenrick Mock]
cin >> key;


if (search(vals, 20, key, index))
== C++ Source Code Links ==
{
cout << "Found at: " << index << endl;
}
else
{
cout << "Not found.\n";
}


bool search(int vals[], int num, int key, int& index)
[http://kotaku.com/5975610/ The Exceptional Beauty of Doom 3’s Source Code]
{
bool found = false;
index = -1;
for (int i=0; i < num; i++)
{
if (vals[i]==key)
{
index = i;
found = true;
break;
}
}
return found;
}

Latest revision as of 12:43, 19 January 2013

My C++

This section includes my C++ notes.

My C++ examples

This section includes my C++ samples.

sort a string array

Books

This section contains the C++ books I have read, used, and suggest.

Problem Solving with C++ /8th Edition by Walter Savitch Kenrick Mock

C++ Source Code Links

The Exceptional Beauty of Doom 3’s Source Code