Search Results

Showing results 1 to 15 of 15
Search took 0.02 seconds.
Search: Posts Made By: dougy83 ; Forum: C++ and child forums
Forum: C++ Dec 29th, 2008
Replies: 12
Views: 640
Posted By dougy83
int &x = *new int();
This should do it.
Forum: C++ Oct 11th, 2008
Replies: 2
Views: 364
Posted By dougy83
setw works fine without the need for '\t'. Note that setw is required prior to each item to be formatted.

e.g. cout << left << setw(12) << "item1" << setw(12) << "item2" << endl;
Forum: C++ Oct 5th, 2008
Replies: 2
Views: 421
Posted By dougy83
Windows CE has APIs for this kind of thing. The prototype for the function is BOOL CopyFile(LPCTSTR lpExistingFileName, LPCTSTR lpNewFileName, BOOL bFailIfExists); .

Go to MSDN if you need info...
Forum: C++ Sep 22nd, 2008
Replies: 9
Views: 601
Posted By dougy83
for(int i = 0; i < ARRAY_SIZE; i++){
int j = rand() % ARRAY_SIZE;

if(i != j)
swap(array[i], array[j]);
}
Forum: C++ Sep 14th, 2008
Replies: 12
Views: 819
Posted By dougy83
Oh don't give up now; you look like you're really close. I'd say there's plenty more weedy students in your class than you.

A lot of the compiler errors are duplicate function definition: it means...
Forum: C++ Sep 8th, 2008
Replies: 4
Views: 976
Posted By dougy83
I tried your program, seemed to run in dev-c++ & visual-c++2008 (with the reported error). Tried debugging it, saw that the stack pointer certainly is different before call to after call (that's bad)...
Forum: C++ Apr 17th, 2008
Replies: 8
Views: 870
Posted By dougy83
That should have been x = y. The complexity of the statement must have confounded me..
Forum: C++ Apr 13th, 2008
Replies: 2
Views: 462
Posted By dougy83
put the srand(time(NULL)); in the main(), such that it is run only once.

As you have it, every time RandomNumber() is called, srand() is seeded with the same value - hence rand() returns the same...
Forum: C++ Apr 11th, 2008
Replies: 6
Views: 2,729
Posted By dougy83
To check if an iterator has passed over all elements compare it to the end (for iterators) or rend (for reverse iterators).

string::reverse_iterator rit = st.rbegin();
string::iterator it...
Forum: C++ Apr 10th, 2008
Replies: 9
Views: 1,861
Posted By dougy83
Why don't you try running the program and pressing the enter key. The program will display the code for the key. Then you can put the key code as a case in the switch() just like what has been done...
Forum: C++ Apr 5th, 2008
Replies: 7
Views: 940
Posted By dougy83
As AncientDragon said, CreateThread() can be used in windows. Check it out on MSDN. Following is some code to show you how to use it. Note that the thread proc should be of the form DWORD WINAPI...
Forum: C++ Mar 29th, 2008
Replies: 2
Views: 681
Posted By dougy83
Also won't always give a number in the range of min...max. You may want to consider using r = (rand() % (max - min + 1)) + min;
Forum: C++ Mar 27th, 2008
Replies: 21
Views: 2,525
Posted By dougy83
Forum: C++ Feb 19th, 2008
Replies: 5
Views: 602
Posted By dougy83
Hey, Why are you closing the input file inside the loop (line 68)?? surely you want to read all the data before closing the file!
Forum: C++ Jun 28th, 2007
Replies: 18
Solved: Insertion Sort
Views: 7,643
Posted By dougy83
Hinduengg,

Insertion sorting is simply inserting each of the unsorted values into the list of sorted values in the location that keeps the list of sorted values correctly sorted. e.g. to sort in...
Showing results 1 to 15 of 15

 


About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC