6,741 Posted Topics
Re: >I just didn't know that I couldn't copy and paste. I learned that plagiarism is a bad thing in the third grade. Aren't you 17? | |
Re: >It is almost as if it does not run to its end. That's exactly what's happening. Run it through your debugger and you'll probably die with an access violation. | |
Re: Use the KeyPress events to check the character being entered. You can find a sample [url=http://www.syncfusion.com/FAQ/winforms/FAQ_c94c.aspx#q830q]here[/url]. | |
Re: Were you born dumb or does it take practice? | |
Re: Do you know about inclusion guards? [code] // myheader.h #ifndef MYHEADER_H #define MYHEADER_H // Your class here #endif [/code] Most likely the error you're getting is a multiple definition error for classA because you used a header without inclusion guards multiple times. | |
Re: VBScript is to C++ as a tricycle is to a Ferrari. Somehow I don't think you'll have any problems learning VBScript. | |
Re: >By the way, I'm speaking of C++, not C or any other types of C. Since this is the C++ forum, we wouldn't assume otherwise. >Tutorials [url]http://home.no.net/dubjai/win32cpptut/html/[/url] >Schools Unlikely. >Books [url]http://www.acceleratedcpp.com/[/url] [url]http://www.mindview.net/Books/TICPP/ThinkingInCPP2e.html[/url] | |
Re: It sounds more like your path isn't set up correctly. If you say "g++.exe" but that program isn't in the current working directory, it won't be found unless the rest of the location is in your system path. | |
Re: >heh, worked for this guy: [url]http://www.helpmegetag5.com/video.htm[/url] Bleh, video editors always come up with the best ideas. | |
Re: >the program runs with a runtime error Make sure you're terminating all of your built strings with '\0'. It doesn't look like you're doing that with some of the arguments to atof, and that could very well give you a runtime error. Of course, you have issues across the board, … | |
Re: Daniweb has an IRC channel. :icon_rolleyes: There are also channels on many servers for the programming language or technology you're interested in. Big ones I've seen are on the EFNet, Freenode, and Undernet servers. But Daniweb's channel needs more active people. | |
Re: It's best to always tag your structures, even if you typedef them: [code] typedef struct mystruct { /* Members */ } mystruct; [/code] or [code] struct mystruct { /* Members */ }; [/code] | |
Re: >sorting the list should help. Sorting the list with a general algorithm gives you (at best) O(NlogN) performance just for the sort. Then you have to determine the duplicates. It also means that you have to store the list somewhere first, which means your storage cost is O(N). If there … | |
Re: "It doesn't work" is hardly a useful problem report. Why don't you post the code that "doesn't work" and tell us what you expected it to do. Then we'll tell you what you did wrong. | |
Re: >I can´t find a generic C code for this problem... That's because there isn't one. Backtracking is a solution strategy, not an algorithm. You can implement it dozens of ways depending on what needs to be backtracked and how. Maybe instead of trying to find something concrete, you should post … | |
Re: A null statement is just a semicolon. It's a statement that does nothing. For example: [code] #include <stdio.h> int main ( void ) { printf ( "Blah\n" ); /* Statement */ ; /* Null statement */ return 0; } [/code] | |
Re: Could you post an example of the input data? ![]() | |
Re: >I already know 60% of the BASIC syntax of c++. What about the semantics. Do you know how to write working C++ of any non-trivial size? Because if you want to do GUIs, non-trivial size is exactly what you'll get. And it's a real pain to struggle with the language … | |
Re: Bumping your thread is extremely rude. It's a great way to get people to completely ignore you. | |
Re: It's good to see more people with programming experience and a desire to help out. :) | |
Re: I'll be looking for you on the software development forums. ;) We can always use helpful people with experience. | |
Re: >But if constructors always have the same name as the class itself, then >why is myFile.open() a constructor? It's not a constructor. In that example the default constructor is used when you say [INLINECODE]std::ifstream myFile;[/INLINECODE]. The default constructor doesn't open any file, so the regular member function open needs to … | |
Re: If I recall correctly, the download sites for each of those will tell you how to install them on your system. | |
Re: Powershell is a command line. Your question makes just as much sense as if you asked us how to write C++ with the DOS prompt. And the answer is the same: use it to open a text editor, write your code in the text editor, use it to run your … | |
Re: >lease do anyone among you know about c software execution optimization.. Yes. | |
Re: >one of them said that C uses 2 bytes in windows for int It hasn't been that way for a while. On many modern implementations, int is 4 bytes and short is 2 bytes. | |
Re: >to be more direct what header is needed for that clock() function time.h | |
Re: >1) interators are "smart access" in that they can keep track of the array position and size. Huh? An index tells you the position, and an iterator doesn't tell you the size of the vector. You're still a little shaky on what iterators are, which is an abstraction (similar to … | |
Re: >Please explain why I need to know the call by reference method. Okay, return two values. | |
Re: >Can anybody suggest the programs or proper API s in Linux. A profiler would be best. Check your system for the existence of gprof. You can also use a number of methods inside of your code to get execution time and timestamps, something like gettimeofday or rdtsc. | |
Re: Do you have your debugging switches set up correctly? If you're not storing debugging information then the only thing the debugger can do is take you to a disassembly. | |
Re: >1). Why can't we use a static_cast for safe downcasting on a polymorphic class? Because static_cast isn't always safe for downcasting. That's why dynamic_cast exists: to perform a runtime check that the cast is legitimate and behave predictably if it's not. >How does this implicit typecast seem to work.? There's … | |
Re: >Is it possible in C++ to have a function that returns a 2-D or indeed an >X-D array from a function, with a specified type such as. No. As already said, you can return a simulated multidimensional array through the use of pointers, but there's no array syntax for return … ![]() | |
Re: It sounds like you want to refactor the changing part of the create member function into the change member function. Then in the create member function, you call change: [code] class Test { public: void create() { // Create stuff change(); } void change() { // Change stuff } }; … | |
Re: >I would like to know if C++ is actually used in games development... Yes, C++ is used in game development. That's actually an understatement since C++ is the de facto standard language for game development. Most modern games are written almost exclusively in C++. | |
Re: >what kind of c++ works best for games? There's only one kind of C++. Don't confuse the tools with the language. >does a type of c++ such as visual C++ 2005 which uses dot net suffice or will it be too slow. Visual C++ 2005 is a compiler, and C++ … | |
Re: >(exit(0) is a function to terminate the program after your work is over >you may use it if you wish and is accessible from process.h) exit is a function in cstdlib, or stdlib.h on your dinosaur of a compiler. The difference is that process.h isn't a standard header, so your … | |
Re: >I got some info. to support the topic here. >At the same time, something that says otherwise here. I don't see the contradiction. Both articles say the same thing, except cprogramming takes a programmer's perspective and Code Project takes an implementor's perspective. >Is references same as a constant pointer to … | |
Re: >have i missed something in the code? Probably. You don't initialize or set the location variable in your search. So basically the entire thing is hopelessly broken as posted. | |
Re: >while(btn_on != btn_off) //wait for btn press I get this tingly sensation that you should be using braces for this loop. That is, of course, if you want both conditional statements to be a part of the loop. If you only care about the first conditional, you're okay. >if (btn_on … | |
Re: >The book has been published in 2002. The C++ standard was ratified in 1998 and was widely implemented for about two years before that. If the author of your book couldn't start using the correct headers with six years of preparation time, I wouldn't try to learn from him. >Should … | |
Re: >neither of them work Because they both attempt to modify a string literal. Change this: [code] char * b = "Hello|World"; [/code] To this: [code] char b[] = "Hello|World"; [/code] I know it looks like nothing, but the difference is huge. The first is a pointer to a string literal, … | |
Re: The ratio of what? If it's time, I'd say for every minute you spend during development, you should expect to spend an hour on maintenance. | |
Re: >but i have little idea of how to do an encryption. So this is your opportunity to learn. Storing a plain-text password anywhere is a really bad idea, so if you want to make claims about security, you need to encrypt it. | |
Re: >It's better than books with hundreds of little shitty exercises >and not a bunch of useless compound interest calculators.. A tad bitter, are we? There's a difference between learning a language and learning how to program. Most books are written as learning a language, where small exercises and programs that … | |
Re: >WaltP - then do something about it. You're a moderator, issue me an >infraction. I'd welcome any sign that this site hasn't spun out of control, >even if the action is directed against me. Name names, take action, do >something about the situation. The moderators should stop sitting on their … | |
![]() | Re: >i was wondering how you go about compiling programs from source for windows XP. We could be of more help if you told us what programming language you want to compile. But at the very least, you need a tool that will turn your source file into something that can … ![]() |
Re: >What is the difference between "\n" and '\n'.? >Also what is the difference between " " and ' '?? Nothing. :D But seriously, the first is a string literal and the second is a character literal. The difference, aside from the data type, is that a string literal is an … | |
Re: >IMO it would have been better to have left her to her own devices to >come up with a solution, instead of writing the entire code. True, but in this case...not so much of an issue. That solution is rather poorly implemented and overly complex. If you're going to use … | |
Re: >How do I bring about this conversion with a single statement? The closest you'll get is Boost::lexical_cast. If you don't want to deal with Boost, it works something like this and the end result is a single statement: [code] #include <sstream> #include <stdexcept> template <typename To, typename From> To lexical_cast … |
The End.