Posts
 
Reputation
Joined
Last Seen
Ranked #621
Strength to Increase Rep
+6
Strength to Decrease Rep
-1
77% Quality Score
Upvotes Received
15
Posts with Upvotes
13
Upvoting Members
13
Downvotes Received
4
Posts with Downvotes
4
Downvoting Members
4
7 Commented Posts
0 Endorsements
Ranked #540
~77.6K People Reached
Favorite Forums

107 Posted Topics

Member Avatar for super-duper

Abstract Data Types is a way to generalize/model software so that the same interface used with different implementations and types. Standard Template Library is a good example of Abstract Data Types. For example the interface for stack is independent of the implementation. Under the hood stack may be implemented by …

Member Avatar for rucha_1
0
2K
Member Avatar for charming-_-eyes

[CODE] std::stringstream out; for(size_t i=0; i < size; i++) { int x = digit[i]; x = x >> i; // do something to digit out << x; } [/CODE]

Member Avatar for Satya Raj
0
506
Member Avatar for John Linux

Objects and thread work together well. Try to model your problem in terms of classes. For example Shuttle can be designed as an active class

Member Avatar for Sergio_1
0
513
Member Avatar for Azmah
Member Avatar for ravenous

Comparing floating point numbers using == or != is not safe. The difference between the two numbers must be compared to some tolerance, usually the system epsilon. (see sample code below). [code] bool isEqual( float v1, float v2 ) { if( std::abs(v1-v2) < std::numeric_limits<float>::epsilon() ) { return true; } return …

Member Avatar for santakdalai90
0
308
Member Avatar for iamthesgt
Member Avatar for markshah2
0
631
Member Avatar for nnaaddrr

Stuff is always hard at first... Take a stab at it, write some code to get started..

Member Avatar for Narue
-2
120
Member Avatar for ztdep

[CODE] bool isSame(double a, double b) { return std::fabs(a - b) < std::numeric_limits<double>::epsilon(); } [/CODE]

Member Avatar for ztdep
0
1K
Member Avatar for gregarion

34 is the right answer two minus becomes plus [url]http://wiki.answers.com/Q/Do_a_minus_and_a_minus_make_a_plus[/url]

Member Avatar for tkud
0
121
Member Avatar for Saith

max is most likely 2, because you must be passing 2 Code presented is incomplete, so its hard to figure out why.

Member Avatar for Saith
0
337
Member Avatar for surferxo3

What is your intent of distance=0? You already initialized the contents of array. Seem like you can just remove that statement. [CODE] void Graph::initialize() { for(int i=0;i<numOfVertices;i++) { mark[i] = false; predecessor[i] = -1; distance[i] = INFINITY; } [B]distance = 0; //here is the problem...[/B] } [/CODE]

Member Avatar for template<>
0
210
Member Avatar for ocramferreira

If you are permitted to do so, you can perhaps load your text file into a std::set and use that as your dictionary.

Member Avatar for iamthwee
0
572
Member Avatar for GamerXxX
Member Avatar for andylbh

Perhaps a custom sort on the vector might solve your problem. See attached link for ideas [url]http://stackoverflow.com/questions/1380463/sorting-a-vector-of-custom-objects[/url]

Member Avatar for mike_2000_17
0
789
Member Avatar for QuesoTaco

Do do not need to or want to put your executable in VC folder. set the path to location of dumpbin (there should be a batch file that sets this path) and run dumpbin on your executable where it is currently locationed

Member Avatar for template<>
0
601
Member Avatar for programing

Perhaps an expression evaluator such as below... [url]http://www.arstdesign.com/articles/expression_evaluation.html[/url]

Member Avatar for template<>
0
124
Member Avatar for Ertzel

This is an observer pattern problem. [url]http://sourcemaking.com/design_patterns/observer[/url] Therefore you need an observer, which keeps a list of all dependents. When an update is received observer loops through and updates all dependents. Using one thread per client is not going to scale very well if you intent to have many chatters. …

Member Avatar for template<>
0
1K
Member Avatar for shadowscape

[url]http://linux.about.com/library/cmd/blcmdl1_md5sum.htm[/url] [url]http://www.gnupg.org/[/url]

Member Avatar for template<>
-1
265
Member Avatar for tonysun

C++ does name mangling to ensure method/function names are unique, C does not. So when calling C function from C++ you need to let C++ know it’s a C function. This can be done using the extern "C", read below for examples [CODE] extern "C" { #include "header.h" } [/CODE] …

Member Avatar for tonysun
0
4K
Member Avatar for eman 22

try using gettimeofday, will give you usec rather than seconds sample code [url]http://www.daniweb.com/software-development/cpp/threads/361138[/url]

Member Avatar for eman 22
0
189
Member Avatar for mbouster
Member Avatar for eman 22

If you have a pointer to array, you can use it as an array... [CODE] int main() { int a[]={1,2,3}; int* p=a; int val=p[0]; } [/CODE]

Member Avatar for mike_2000_17
0
88
Member Avatar for pravej

try it in c first, just for fun. Here is something to get you started, complete the function, use algorithm described by Narue.. [CODE] char *reverse( char *input) { } [/CODE]

Member Avatar for template<>
0
246
Member Avatar for cableguy31

[CODE] struct timeval { unsigned long tv_sec; /* seconds since Jan. 1, 1970 */ long tv_usec; /* and microseconds */ }; [/CODE]

Member Avatar for template<>
0
373
Member Avatar for CodyOebel

perhaps something like this [url]http://stackoverflow.com/questions/5265607/how-to-send-double-click-on-keyboard-focused-object-from-c[/url]

Member Avatar for template<>
0
147
Member Avatar for Gnomy

Seems, fine, ensure you have the correct headers. [CODE] #include <vector> #include <string> int main() { std::vector<std::string> TexName; TexName.push_back("mega.png"); return 0; } [/CODE]

Member Avatar for template<>
0
547
Member Avatar for arun srinivaas
Member Avatar for hag++
0
142
Member Avatar for IndianaRonaldo

1. Allocation means to create space for your application use 2. Initialize means to assign specific values to that space Using malloc creates space, but contents of space undefined

Member Avatar for IndianaRonaldo
0
215
Member Avatar for pritpal.singh88
Member Avatar for sergent
0
940
Member Avatar for template<>

Hello Community, I am trying to figure a simple way approximate cost of context switching for a given OS/hardware combination under different loads. For example on my 2 GHz dual core MAC OSX, running single instance clocks at 0.5 usec where as three instance at 1.3 usec. Below is sample, …

Member Avatar for template<>
0
381
Member Avatar for trips_shubh

1. use typedefs to simlify your code 2. use strings rather than char* for key in containers. 3. if you must use char *, custom comparison perdicate must be provided Below is simple sample [CODE] #include <iostream> #include <string> #include <map> int main() { typedef std::map<std::string,std::string> TMap; TMap m; m["k2"] …

Member Avatar for trips_shubh
0
5K
Member Avatar for jmalbornoz

Quote: "However, I am developing a collection of classes and I need them all to share a common variable (a time step) whose value will be defined by the user." Since the values is defined by user, its similar to a configuration value, therefore const is probably not what you …

Member Avatar for jmalbornoz
0
3K
Member Avatar for ashrafu1

If you reorganized, restructure and format you code so it easy to read and understand, it will simplify finding both logic and syntax problems. As your programs get larger, good code organization will save you lots of time and effort. If I read correctly, line 31 is the end of …

Member Avatar for ashrafu1
0
202
Member Avatar for ztdep
Member Avatar for kumarmpk4u
Member Avatar for drkybelk
0
517
Member Avatar for jfunchio
Member Avatar for saya_afiq
Member Avatar for rahman86
-2
79
Member Avatar for kutuup

It appears linker is not seeing the definitions for Client. Is Client.cpp compiled and linked with application?

Member Avatar for kutuup
0
267
Member Avatar for Ancient Dragon

[QUOTE]It returns the number of seconds since 1970, as you previously posted. It doesn't matter whether the parameter is NULL or not, it will always return the same value.[/QUOTE] Although the c standard may be fuzzy on the topic, the posix standard appears to be more specific. Although exception are …

Member Avatar for Ancient Dragon
0
371
Member Avatar for Giorgio33
Member Avatar for fabricetoussain

Perhaps try something like below... [CODE] #include <iostream> #include <string> using namespace std; int main() { int start; int end; cout << " Time Clock Program" << endl; cout << "Enter Start time (hh:mm A/P): "; cin >> start; cout << std::endl << "Enter Stop time (hh:mm A/P): "; cin …

Member Avatar for fabricetoussain
0
332
Member Avatar for dospy

[CODE] struct Point; // forward reference struct MyClass1{Point &p;}; // reference to Point (ok) struct MyClass2{Point *p;}; // pointer to Point (ok) strcut MyClass3{Point p;}; // Pointer Object (compile error) [/CODE] Forward reference are used to inform the compiler a name is valid and defined somewhere else. However if the …

Member Avatar for dospy
0
116
Member Avatar for Khoanyneosr

It seems like the linker thinks there is no int main() function..., what does you main look like?

Member Avatar for Khoanyneosr
0
271
Member Avatar for xyzt

[CODE] /// /// below is pseudocode/pattern on a possible way to /// start a pool of thread and end them gracefully /// need thread and conditon variable implementation /// #include <iostream> #include <vector> /// /// replace with your thread class /// class Thread { public: virtual ~Thread(){;} protected: virtual void …

Member Avatar for thekashyap
0
176
Member Avatar for sdr001
Member Avatar for ntrncx
Member Avatar for template<>
0
206
Member Avatar for errorlog2

Depends on what you want/like to do and which platforms you are interested in... Having said that, c++ is a good language to have in your skill set.

Member Avatar for ntrncx
0
191
Member Avatar for lochnessmonster

An alternative is to have the push return true/false... [CODE] template<int MAX_SIZE> class Stack { public: Stack() :_count(0) { } bool push(int val) { if( _count < MAX_SIZE ) { _array[_count++] = val; return true; } return false; } private: int _count; int _array[MAX_SIZE]; }; [/CODE]

Member Avatar for WaltP
0
93
Member Avatar for subith86

I am able to compile and link using g++, with changes below. 1. in FriendClass.h remove MyClass.h include and provide forward declaration for MyClass 2. In MyClass.h include FriendClass.h

Member Avatar for jonsca
0
2K
Member Avatar for sirko

Some windows synchronization objects, its usually best to use c++ wrappers with these (google for more information) [url]http://msdn.microsoft.com/en-us/library/ms685129(v=vs.85).aspx[/url] [url]http://msdn.microsoft.com/en-us/library/ms682411(v=vs.85).aspx[/url] [url]http://msdn.microsoft.com/en-us/library/ms682530(v=vs.85).aspx[/url] [url]http://msdn.microsoft.com/en-us/library/ms682396(v=vs.85).aspx[/url]

Member Avatar for rubberman
0
192

The End.