107 Posted Topics

Member Avatar for sdr001

Without having code that compiles... The signature may be incorrect. void insertNode(T); Seems like you want to insert a node, not a type, which is represented by T?

Member Avatar for sdr001
0
117
Member Avatar for highflyer8

do you have a class threevector? most probably fourvector contains the threevector member variable fourvector constructor is initializing the three vector constructor

Member Avatar for Saith
0
137
Member Avatar for jkoske
Member Avatar for digitup1

Instead of timing how long it takes to run qsort sort once, execute qsort n times in a loop and see how long that takes. Vary n, until you get a reasonalble time. // startTime; for (size_t i=0 i < 100000; i++ ) { qsort(); } // endTime

Member Avatar for template<>
0
190
Member Avatar for a.muqeet khan

use the CODE blocks to demark your code, so its simpler to read [CODE] class Hello { }; [/CODE]

Member Avatar for a.muqeet khan
0
115
Member Avatar for subith86

If you don’t initialize your variables, you will get garbage... garbage in this case is any value that int is capable of representing...

Member Avatar for template<>
0
122
Member Avatar for COL_Milkshake

Its usually a good idea to put a include guard on you header files to prevent conflicts if they are included multiple times. Alternatively you can use #pragma once, although its not part of the standard. [CODE] #ifndef HEAP_H #define HEAP_H class Heap { public: }; #endif [/CODE]

Member Avatar for template<>
0
110
Member Avatar for doraditya

Basic algorithm is to find a space and then remove all subsequent spaces. Check out some of the std::string methods (find, erase) [url]http://www.cplusplus.com/reference/string/string/[/url]

Member Avatar for template<>
-2
57
Member Avatar for highflyer8

The code does not make any sense. Would be helpful to describe what you are trying to do in words. For example what are you trying to do with the while loop? What is the problem you're trying to solve?

Member Avatar for template<>
0
113
Member Avatar for bfprii
Member Avatar for iamcreasy

In c/c++ its a good idea to initialize variables to some known state. Unintialized variables causing problem has kept many a programmer debugging for hours. In C++ Null is defined as 0. See section on "Should I use NULL or 0?" for some words of wisdom from the master himself. …

Member Avatar for template<>
0
19K
Member Avatar for Annettest
Member Avatar for sara90
Member Avatar for gazsroeposc

Below is one way to break it into token... [CODE] #include <sstream> #include <string> #include <iostream> int main() { std::stringstream ipv6("2001:0db8:0000:0000:0000:0000:1428:57a"); char seperator=':'; std::string token; const size_t MAX_BYTE=8; for( size_t i=0; i < MAX_BYTE; i++ ) { std::getline(ipv6,token,seperator); std::cout << token << std::endl; } } [/CODE]

Member Avatar for gazsroeposc
0
2K
Member Avatar for mxrider
Member Avatar for ravenous
0
146
Member Avatar for tomtetlaw

Rather than put raw pointers, a common technique is to use shared pointers, which use reference counting. Otherwise need to need to iterate and delete your own objects

Member Avatar for Rashakil Fol
0
6K
Member Avatar for lima01

Get a few books on socket programming and start playing around. Two well know authors are W. Richard Stevens and Douglas E. Comer.

Member Avatar for dennisschagt
0
316
Member Avatar for ntrncx

Learn to think and design your programs in terms of real world concepts and use classes to express these ideas.

Member Avatar for ntrncx
0
130
Member Avatar for sarge66

Ok so start the debugger and step through the code. If you never used it before get someone to walk you through it...

Member Avatar for template<>
0
208
Member Avatar for jimJohnson

GOOGLE [url]http://www.codeguru.com/forum/showthread.php?t=360665[/url] You are probably compiling for multi-byte, is that what you really want?

Member Avatar for luce
0
213
Member Avatar for jkoske
Member Avatar for arjunaw

You could create one thread as a service thread that calls the public methods of your objects every minute...

Member Avatar for arjunaw
0
4K
Member Avatar for TigrisAltaica

probably good idea to check return codes for errors. For example if you are not able to open the file...

Member Avatar for TigrisAltaica
0
154
Member Avatar for Jennifer84
Member Avatar for Jennifer84
0
121
Member Avatar for akase2010

[url]http://stackoverflow.com/questions/4825030/c-add-to-linked-list-in-sorted-order[/url]

Member Avatar for Fbody
0
130
Member Avatar for MasterGberry
Member Avatar for Koinutron

[CODE] template <typename Tdata> void q1_sort(vector<Tdata> &A, int left, int right) { if((right-left) < ISORT_CUTOFF){ if(data_t == 1) {in_sort<[COLOR="Red"]Tdata[/COLOR]>(A, (int)left, (int)right+1);} else if(data_t == 2) {in_sort<[COLOR="red"]Tdata[/COLOR]>(A, (int)left, (int)right+1);} } else{ q1_sort<[COLOR="red"]Tdata[/COLOR]>(A, left, i-1); q1_sort<[COLOR="red"]Tdata[/COLOR]>(A, i+1, right); } } [/CODE]

Member Avatar for Koinutron
0
416
Member Avatar for GregPeters
Member Avatar for txwooley
0
230
Member Avatar for w1mark

pseudorandom21 solution is clean and simple, spend some time to understand it [CODE] #include <iostream> #include <string> #include <sstream> int main() { std::stringstream strm("it your move"); std::string token; while(strm >> token) { std::cout << token << std::endl; } return 0; } [/CODE]

Member Avatar for w1mark
0
539
Member Avatar for MasterGberry

Not clear what you mean by different memory address. Perhaps read each dataPY.bar into a different instance of a DataPY class?

Member Avatar for MasterGberry
0
373
Member Avatar for Stefano Mtangoo

Should be fun, did an editor for debugger before with syntax highlighting etc. Try to design everything in terms of objects, should be good learning experiance. For example create a object model for your editor and implement using classes.

Member Avatar for Stefano Mtangoo
0
135
Member Avatar for skips
Member Avatar for skips
0
151
Member Avatar for Sherry.K

1. First figure out how to do it by hand 2. Then search google to see how others have solved the problem 3. Finally write your program [url]http://www.indiastudychannel.com/projects/2080-C-Program-To-calculate-compound-interest-using-CI-P-R-T-P.aspx[/url]

Member Avatar for VernonDozier
-4
599
Member Avatar for poloblue
Member Avatar for bailsb

can you provide expression.h [url]http://msdn.microsoft.com/en-us/library/t8xe60cf(VS.80).aspx[/url]

Member Avatar for bailsb
0
2K
Member Avatar for Staggasaurarts

google c++ to php examples [url]http://stackoverflow.com/questions/705443/how-to-mix-up-c-and-php[/url]

Member Avatar for ziggystarman
0
1K
Member Avatar for rlamarche
Re: FIFO

If its a cpu scheduler performance is probably important which implies perhaps a ring-buffer type structure might be useful Can you describe in more detail what you are trying to do?

Member Avatar for template<>
0
125
Member Avatar for Muhammad Sumair

[CODE] int main() { int row = 10; int col = 4; // col of pointers to rows int **dynamicArray = new int *[col] ; // array for each row for( int i = 0 ; i < col; i++ ) { dynamicArray[i] = new int[row]; } // initialize with …

Member Avatar for template<>
0
149
Member Avatar for carlo0133
Member Avatar for hanvyj

GetTickCount() might give you what you want. [url]http://msdn.microsoft.com/en-us/library/ms724408(v=vs.85).aspx[/url]

Member Avatar for hanvyj
0
196
Member Avatar for DaniwebOS

Rather than DayOfTheWeek.getDay, use getDay() Since you are calling a method of the class from withing the class

Member Avatar for template<>
0
289
Member Avatar for CanaznFTW

In times of need, Google is your friend!!! [url]http://stackoverflow.com/questions/190229/where-is-the-itoa-function-in-linux[/url]

Member Avatar for CanaznFTW
0
408
Member Avatar for user543820

[CODE] #include <iostream> #include <string> #include <sstream> int main() { std::stringstream expression(" 3 + 4 ( 5 * 8 "); std::string token; const char DELIMITER(' '); while (std::getline(expression, token, DELIMITER)) { std::cout << token << std::endl; } } [/CODE]

Member Avatar for Ancient Dragon
0
173
Member Avatar for thisischris

You might want to consider to first break the problem into set of points (x,y). Then extract and convert each set of points to numbers.

Member Avatar for thisischris
0
219
Member Avatar for axeves

It would be good practice to always check your return codes. If you do so, you will most likely find your error.

Member Avatar for template<>
0
138
Member Avatar for Kelikmalok
Member Avatar for arkoenig
0
154
Member Avatar for honeythigh

1. Ofcourse newbies can learn C++!!! 2. Not a game programmer, but I suspect lots of games use c++ since performance is important 3. I use a mac at home, linux/windows at work. You already have everything you need. a. open a terminal window on your mac b. type nano …

Member Avatar for honeythigh
0
411
Member Avatar for bkoper16

Interesing syntax, I thought array initialization has to be a constant??? Is'nt that going to go out of range and cause all kinds of interesing problems? since i is incremented further down... int i = 0; int sales[i];

Member Avatar for template<>
0
212
Member Avatar for gl7

Below is a example of one way to remove an item from a vector using an iterator. [CODE] class Eraser { public: Eraser() { _vector.push_back("fred"); _vector.push_back("alice"); _vector.push_back("billy"); } bool remove(const std::string &who_) { for( TVec::iterator i=_vector.begin(); i!=_vector.end(); ++i ) { if( *i == who_ ) { std::cout << who_ << …

Member Avatar for gl7
0
155
Member Avatar for akase2010

You are on the right track, below is sample of array using index and pointer. [CODE] #include <iostream> int main( int argc, char *argv[]) { const size_t LIMIT = 8; int buffer[LIMIT] ={0}; // array access using index notationn for(size_t i=0; i < LIMIT; i++) { buffer[i] = i; } …

Member Avatar for template<>
-2
125

The End.