3,892 Posted Topics

Member Avatar for Lazaro Claiborn

I guess I did post a [URL="http://www.daniweb.com/techtalkforums/post326797-9.html"]similar code[/URL] in another thread.... ;)

Member Avatar for Lazaro Claiborn
0
157
Member Avatar for Duki

You need to be a bit more specific. What did you expect from your code and what kind of behaviour is it displaying as of now... Oh and btw, taking a look at your code, I see that you have used floating point variables as your loop variables which is …

Member Avatar for Salem
0
178
Member Avatar for ajay_tabbu

[quote=ajay_tabbu;326147]2nd ponit is that if i if make any class as main class by public static void main then all the method of that class become static so in case of inner class if i make outer class as the main class then what happend with inner classes wether that …

Member Avatar for jwenting
0
242
Member Avatar for paeez

Though I can pretty much bet that the given the kind of code inlined, the compiler will ignore his request for inlining...

Member Avatar for ~s.o.s~
0
126
Member Avatar for Brent.tc

The only requirement is that you should be working on a Windows OS and the compiler you use should have the required header files ( windows.h) Also read [URL="http://www.daniweb.com/techtalkforums/post324544-2.html"]this.[/URL]

Member Avatar for ~s.o.s~
0
3K
Member Avatar for luck4mike

Hey there Mike, welcome to Daniweb. :D Hope you have tech time here... ;)

Member Avatar for happygeek
0
22
Member Avatar for nayrb

Which IDE are you using ? The process normally involves creating a new console project (if thats what you want), adding the required header and source files to it (preferably in the same folder). The header and the source files are generally added by right clicking on the project name …

Member Avatar for thekashyap
0
98
Member Avatar for The Dude

Well I am just a simple man with simple needs, who believes in making a difference whereever he can. As far as selecting an option is concerned...*hmm*

Member Avatar for jbennet
0
138
Member Avatar for Shaabangbang

You are getting an error because you are trying to print the "input stream" and not the "character array". In your use of [I]fgets ( ) [/I], "input" is the stream from which you are reading, line by line. [code=c] char buffer [BUFSIZ] = { '\0' } ; while ( …

Member Avatar for Shaabangbang
0
152
Member Avatar for mapaputsi

[URL="http://www.daniweb.com/techtalkforums/showthread.php?t=13488&highlight=big+o"]*agrees*[/URL]

Member Avatar for ~s.o.s~
0
161
Member Avatar for evilsilver

You need to tell the compiler that the class you are using exists. You do this by something known as forward declarations. [code=cplusplus] // Enemy.h #ifndef ENEMY_H #define ENEMY_H class Player ; // forward declaration class Enemy { int c ; int d ; public: int get (Player a) ; …

Member Avatar for evilsilver
0
120
Member Avatar for nayrb

[quote=joeprogrammer;324849]But the OP did this. Reread the code; there's nothing wrong with the way he/she implemented preprocessor directives.[/quote] ....albeit, in a wrong way. When you write guards like that to prevent recursive inclusion, you need to specify the Header file name in the preprocessor directives and not the class name. …

Member Avatar for nayrb
0
123
Member Avatar for Laiq Ahmed

The first sequence you posted has a distinct pattern, but I see no repeating or logical pattern in the second sequence ? Try to put down your thoughts in a more concise manner and you would yourself know the algorithm.

Member Avatar for Laiq Ahmed
-1
116
Member Avatar for HostChart

[quote=sharky_machine;286657]I vote for this also: Ruby\ ROR. This is becoming a vastly growing language. Many sites do not host a forum area for this either. A new Ruby forum may just attract more to this thriving community. Thanks, sharky_machine[/quote] But I hope you understand that creating a forum requires atleast …

Member Avatar for tins
0
411
Member Avatar for jan1024188

Look into the functions [I]RegOpenKeyEx, RegQueryValueEx[/I] and [I]RegCloseKey. [/I]They are used for opening the registry, reading values from the registry and closing it. Refer the MSDN for more details. An example snippet [URL="http://msdn2.microsoft.com/en-us/library/ms724429.aspx"]here.[/URL]

Member Avatar for Lazaro Claiborn
0
538
Member Avatar for nayrb

The way you are trying to incorporate the wrong concept of const variables in your program is causing all the problems. If you declare a variable as const, you need to specify the const qualifier before the dataype, like this: [code=c] const int SIZE = 10 ; // you must …

Member Avatar for torbecire
0
92
Member Avatar for jbennet

Many people register, bash their head against the wall in trying to find how to "Post a new thread", give up. End of story for them...

Member Avatar for WaltP
0
530
Member Avatar for moeski301
Member Avatar for mattyd
0
69
Member Avatar for MattEvans

As far as virtual functions are concerned, they definately incur some performance overhead, but in normal senarios, the cost and nightmares of maintaining repeatitive code is far more than that when virtual functions are used. The most important point you have to consider while using virtuals is that the [U]binding …

Member Avatar for thekashyap
0
119
Member Avatar for RisTar

Not to forget that his scheme will work only for characters whose count is less than or equal to 9. Any higher and the algo is busted. @OP Maybe you should try out [search]sprintf[/search] instead of adding plain ascii characters.

Member Avatar for ~s.o.s~
0
134
Member Avatar for RisTar

So atleast try out something you have in your mind and post it here. Help will automatically ensue..

Member Avatar for RisTar
0
105
Member Avatar for nadith_cs

[quote=nadith_cs;324225]so can you explain how this variable declaration works when it get repeated. y won't u get the error the redefinition of var x?[/quote] Think of this as declaring a variable in the naked block, whose scope and lifetime is limited to the block in which it is declared. [code=c] …

Member Avatar for ~s.o.s~
0
127
Member Avatar for livingsword

That is becuase the functions which you mentioned are compiler specific (Turbo C specific) and not part of the standard library. They can be easily removed and circumvented or replaced. For a list of all standard functions in C and C++ see [URL="http://www.cppreference.com"]this[/URL]... As an example, you can remove getche() …

Member Avatar for dwks
0
141
Member Avatar for RisTar

Code examples which use Turbo C can be found [URL="http://www.codearchive.com/list.php?go=0709"]here. [/URL]Another good tutorial can be found [URL="http://electrosofts.com/cgraphics/"]here.[/URL] Reference for Turbo C can be found [URL="http://www.sandroid.org/TurboC/"]here.[/URL] The above resources should be enough to get to started provided you know a fair amount of C programming.

Member Avatar for Narue
-1
2K
Member Avatar for torbecire

I have already warned you before not to use colors to fomat your code and enclose them in code tags. I am fed up of editing your posts. The way you post makes it difficult to read your post. The same thing next time will fetch you an infraction. And …

Member Avatar for Narue
0
151
Member Avatar for ajay kandari

Arrays in C are passed by reference i.e. meaning that you only need to pass around the array address to the function and that array will be accessed and used in a normal way in that function. Change you function call to [I]values ( x ) ; [/I]and you should …

Member Avatar for Ancient Dragon
0
92
Member Avatar for vijayshekhar
Member Avatar for Duki

[URL="http://www.daniweb.com/techtalkforums/post312538.html#post312538"]This[/URL] thread might interest you...

Member Avatar for Duki
0
99
Member Avatar for dahlia_06

The "modify methods" or "setter methods" are more popularly or formally known as "Mutator functions". I agree with Joey in that the third category is not a formal one. I can make a pretty guess that the methods which are neither Accessors nor Mutators fall under the category of so …

Member Avatar for ~s.o.s~
1
542
Member Avatar for rQQt2

Two problems I can see: • Your memory allocation is not proper. Each of your rows share a common vector variable because of the stmt: [code=cplusplus] vector<int> v(n); vector<vector<int> > data(n,v); [/code] Here the memory for each inner row is getting allocated only once and your two dimensional matrix gets …

Member Avatar for rQQt2
0
449
Member Avatar for livingsword

[quote=livingsword;323100]if i initialize the array in main() or constructor, the other functions which use that array give error : 'array not defined'.[/quote] Thats because they can't see the array or the array is out of scope for them. Post the code which displays this peculiar behaviour and we will see …

Member Avatar for ~s.o.s~
0
119
Member Avatar for ctrohana

I guess Lamabot's reply should be used as a template for those who are in need of ready code.... its less sarcastic, snappy and cocky. ;)

Member Avatar for ~s.o.s~
0
167
Member Avatar for manjurekha

Read the [B]Equality[/B] section of [URL="http://www.cprogramming.com/tutorial/floating_point/understanding_floating_point_representation.html"]this[/URL] article.

Member Avatar for ~s.o.s~
0
48
Member Avatar for bploog

You need to invoke the program from the command line using the executable created after the compilation process to work.

Member Avatar for bploog
0
244
Member Avatar for bikash123

Hey there buddy, welcome to Daniweb. :D Hope you have a great time here..

Member Avatar for jbennet
0
51
Member Avatar for Tauren

[quote=Lazaro Claiborn;321910]If money is no issue, I actually found a book named "How to C++ program - Second Edition" by Deitel & Deitel [/quote] Too much spoon feeding. Text not on par with other professional books out there. The only thing good about those books are the practice problems. They …

Member Avatar for jbennet
0
113
Member Avatar for degamer106

Your overloaded + operator takes another car object's reference as an input, while the way you have used it in your program, it would require an overloaded operator which takes in an integer as input. Your first two constructors are ambiguous since for a particular condition (when only cost is …

Member Avatar for ~s.o.s~
0
104
Member Avatar for The Dude

Oh come on, give him a break. After all he is way younger than those who think that those questions are stupid... But agreed, they are easy ones. I have seen worse... ;)

Member Avatar for RwCC
0
193
Member Avatar for >shadow<

But I am already undead and enjoying myself pretty well....What more can I ask for ? ;)

Member Avatar for paramasivan
1
149
Member Avatar for BleedingEdge

E) When you have nothing better to do than criticize some stupid games played on the message boards.... ;)

Member Avatar for christina>you
-1
86
Member Avatar for shafiq ahmad

Hello there my friend, welcome to Daniweb :D Hope you enjoy yourself here.... ;)

Member Avatar for christina>you
0
25
Member Avatar for The Dude

[quote=Ancient Dragon;315158]Hey Dude -- apparently you are the only one who used an iPod :mrgreen: I don't own one either -- I just got my first cell phone for Christmas and I rarely use it.[/quote]Funnily enough, its the same case with me... ;)

Member Avatar for GreenDay2001
0
380
Member Avatar for torbecire

[quote=Ancient Dragon;321235]I don't have a clue what question you are asking. function ch_in_string() -- there's a lot easier way to do that. std::string has a find method [code] bool ch_in_string(char ch, string s) { return s.find(ch) == string::npos) ? true : false; } [/code][/quote] I guess that should be : …

Member Avatar for WaltP
0
100
Member Avatar for frog3764

Hello Jim, welcome to Daniweb :D Hope you enjoy yourself here. I guess that's all from this side as well... ;)

Member Avatar for christina>you
0
63
Member Avatar for bananenflip

1) Codeblocks IDE integrated with MINGW compiler can be downloaded at [URL]http://www.codeblocks.org/downloads.shtml[/URL] 2) Bloodshed Dev C++ IDE with MINGW port of GCC as its compiler at [URL]http://www.bloodshed.net/devcpp.html[/URL] 3) Visual Studio Express Edition [URL]http://msdn.microsoft.com/vstudio/express/visualc/download/[/URL] I personally recommend the first one i.e. Code::Blocks.

Member Avatar for bananenflip
0
301
Member Avatar for chubbywubba

Some points: • You are missing two closing braces at the end of the program. • In your class definition remove the class names before the functions since they are only needed when you provide function body to your functions outside the class. [CODE=cplusplus]GridActive& GridActive::operator= (const GridActive & grid); // …

Member Avatar for WaltP
0
86
Member Avatar for earlyriser

[quote=iamthwee;319062]You just don't use malloc with c++ period. Unless you want undefined behaviour.[/quote]That would be only if you use them to allocate memory for non-POD (plain old data). For datatypes like integers, floats etc. you can still use malloc though is much frowned upon in the C++ community.

Member Avatar for ~s.o.s~
0
290
Member Avatar for n.aggel

If your I/O activities are performed by a central class you can be rest assured that at a time only a single class or a class function is writing to a file since the the opening and closing of the file stream would be under the control of the central …

Member Avatar for Lazaro Claiborn
0
107
Member Avatar for jobra

[quote=Lazaro Claiborn;318382]They're not overwritten, this can be proved by the following: [code=cplusplus] #include <iostream> #include <vector> using namespace std; class cool { public: cool(string hello) {str = hello;} ~cool(){}; string str; protected: private: }; int main() { vector<cool> tempc; cool *temp; string hello[] = {"Yes", "No", "Maybe", "So"}; int i; …

Member Avatar for John A
0
136
Member Avatar for bigben09

Don't use global variables. Its a bad programming practice considering the job can be very well done using local ones. As far as your method is considered its a bit unclean but still if you want to strip off the leading zeroes check one more condition which keeps skipping zero …

Member Avatar for John A
0
128

The End.