3,892 Posted Topics
Re: I guess I did post a [URL="http://www.daniweb.com/techtalkforums/post326797-9.html"]similar code[/URL] in another thread.... ;) | |
Re: 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 … | |
Re: [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 … | |
Re: Though I can pretty much bet that the given the kind of code inlined, the compiler will ignore his request for inlining... | |
Re: 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] | |
Re: Hey there Mike, welcome to Daniweb. :D Hope you have tech time here... ;) | |
Re: 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 … | |
Re: 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* | |
Re: 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 ( … | |
Re: [URL="http://www.daniweb.com/techtalkforums/showthread.php?t=13488&highlight=big+o"]*agrees*[/URL] | |
Re: 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) ; … | |
Re: [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. … | |
Re: 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. | |
Re: [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 … | |
Re: 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] | |
Re: 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 … | |
Re: 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... | |
Re: 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 … | |
Re: 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. | |
Re: So atleast try out something you have in your mind and post it here. Help will automatically ensue.. | |
Re: [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] … | |
Re: 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() … | |
Re: 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. | |
Re: 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 … | |
Re: 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 … | |
Re: [URL="http://www.daniweb.com/techtalkforums/post312538.html#post312538"]This[/URL] thread might interest you... | |
Re: 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 … | |
Re: 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 … | |
Re: [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 … | |
Re: 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. ;) | |
Re: Read the [B]Equality[/B] section of [URL="http://www.cprogramming.com/tutorial/floating_point/understanding_floating_point_representation.html"]this[/URL] article. | |
Re: You need to invoke the program from the command line using the executable created after the compilation process to work. | |
| |
Re: [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 … | |
Re: 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 … | |
Re: 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... ;) | |
Re: But I am already undead and enjoying myself pretty well....What more can I ask for ? ;) | |
Re: E) When you have nothing better to do than criticize some stupid games played on the message boards.... ;) | |
Re: Hello there my friend, welcome to Daniweb :D Hope you enjoy yourself here.... ;) | |
Re: [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... ;) ![]() | |
Re: [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 : … | |
Re: Hello Jim, welcome to Daniweb :D Hope you enjoy yourself here. I guess that's all from this side as well... ;) | |
Re: 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. | |
Re: 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); // … | |
Re: [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. | |
Re: 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 … | |
Re: [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; … | |
Re: 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 … |
The End.