- Strength to Increase Rep
- +15
- Strength to Decrease Rep
- -3
- Upvotes Received
- 178
- Posts with Upvotes
- 153
- Upvoting Members
- 94
- Downvotes Received
- 0
- Posts with Downvotes
- 0
- Downvoting Members
- 0
- Interests
- programming, 3d modelling & animation, archery, martial-arts, reading, camping, hmm... what…
Re: Typically the main icon is linked in at compilation. How exactly you do it depends on your compiler. In all cases, a Windows resource named MAINICON is in your exe. You can also check out [URL="http://angusj.com/resourcehacker/"]Resource Hacker[/URL], which you can use to manually change a program's icon. | |
Re: The best way to learn actually is to try to do it yourself. A good reference is always a very useful help. I refer to these two often: [URL="http://www.cppreference.com/"]C/C++ Reference[/URL] (short and sweet) [URL="http://www.cplusplus.com/"]cplusplus.com[/URL] (all the gory details) Start small, add on details as you go, and you'll be able … | |
Re: Since you are compiling with the [inlinecode]UNICODE[/inlinecode] flag, you must either indicate that string literals are wide-char directly: [inlinecode]L"Hello world!"[/inlinecode] or (better yet) use the [b]TEXT[/b]() macro: [inlinecode]PlaySound(TEXT("beep.wav"), 0, SND_LOOP|SND_ASYNC);[/inlinecode] Have fun. | |
Re: [URL="http://www.parashift.com/c++-faq-lite/templates.html"]http://www.parashift.com/c++-faq-lite/templates.html[/URL] | |
Re: You'll also improve your program's safety by using the [b]std::string[/b] type: [code=C++] #include <fstream> #include <iostream> #include <string> using namespace std; int main() { string filename; cout << "Name your file> "; getline( cin, filename ); fstream file( filename.c_str() ); if (!file) { cout << "I could not open the … | |
Re: Hey there, just a heads-up to let you know that help is forthcoming. I just had to go learn how to solve a linear system of equations using gaussian elimination and partial pivotization first. Now I'm looking over your code. I've got a few suggestions about commentary and variable names, … | |
Re: The TMediaPlayer component should be able to play with any codec installed on your computer. Can you play the file normally using Windows Media Player from Explorer? | |
Re: His question is why the rewritten stuff on Windows 7 works so much faster than what he had been using. @OP: You state that you are using `CopyFileEx()` (a Win API function) on Unix systems and it is going slow. Assuming your original code does not have any hooks on … | |
Re: I notice you are spamming the forum with a lot of questions that you could easily get the answer to by simply reading [the documentation](http://en.cppreference.com/w/) or simple searches on Google. What about my answer to [this same question](https://www.daniweb.com/software-development/c/threads/490534/c-preprocessor-directives) needs you to start another thread to ask it again? | |
Re: There is no exhaustive list, because each compiler system + OS has their own. There are common, standard ones, though. [Here's the GNU CPP's documentation.](https://gcc.gnu.org/onlinedocs/cpp/Index-of-Directives.html#Index-of-Directives) Hope this helps. | |
Re: Why are you subtracting 1 on line 11? | |
Re: Plenty of people still program with ancient, pre-standard compilers, particularly in places like India. Also, there does exist the [WinBGIm port](http://winbgim.codecutter.org/) for MinGW, so old BGI code certainly can and does compile with modern GCC. Alas, I am currently reinstalling my compiler (I managed to hose it with an 'automatic … | |
Re: No. All (normal) messages go to a window event handler. The functions you write to handle events can, of course, be as window agnostic as you like. | |
Re: Why is everyone trying to quicksort a linked list? | |
Re: I hesitate to link to another site for your answer, but your question about how to use `qsort()` is entirely answered in the FAQ [here](http://www.cplusplus.com/faq/sequences/sequencing/sort-stuff/#c). It explains how `qsort()` works and gives an example of randomizing data with it. That comparison function is the key to making it work. Hope … | |
Re: I'm confused. Are you talking about a circular buffer? | |
Re: I wish I could say. Richedit does have some random issues. 1) Make sure you are linking to the most current RichEdit DLL (4.1). 2) Make sure your window with the RichEdit control is *not* doublebuffered. 3) Make sure your manifest is correct. I assume you are using the RichEdit's … | |
Re: Is there something left out about the format of the data you are searching? There is no way to search *random* data faster than O(n). However, if your data were *sorted* then you could search it in O(log n). Also, every time you add extra code to do something the … | |
Re: stty is not the best option for this. You should first look to see if the environment variable $COLUMNS exists. It is most likely to be correct. Failing that, use the command `tput cols` to query the terminal size. If you really want to do it properly though you'll have … | |
Re: What you've got seems to introduce but not use 't', and has a bug on line 16 (when temp->next is NULL). Also, you are endeavoring to do two things at once: sort *and* display. Don't do that. Put the sort stuff in its own function. Sorting is not particularly easy, … | |
Re: To be clear, *no*, you *cannot* override static methods. (You can *overload* them, though.) The reason is simple: a static method cannot appear in a class's virtual function table, so it is not inherited. In order to call a static method you must know exactly what type of object you … | |
Re: Using a library and decoding an image yourself are two totally different things. The OP cannot change his compiler's environment, but there is never any restriction on the files you can create for a single-user directory (outside of diskspace, of course). Using CImg would work fine. (I know this is … | |
Re: That code is wrong in a number of subtle and dangerous ways. But what it is trying to do is write the binary value of a 'PasswordGenerator' object to file. Any object you wish to write should have a function to explicitly convert it to either text or binary. If … | |
Hey all. I'm always frustrated that I cannot seem to find a reference that shows when a feature was *introduced* in Delphi. For example, to use ErrOutput, I have to manually create that value in D5. But what about D6? or D7? Does such a reference exist? | |
Re: Apple is putting a lot of effort into LLVM. Unfortunately, the LLVM debugger doesn't work with FPC (yet, AFAIK). You'll either have to get an old copy of the GDB or install an older version of X-Code (you can do this side-by-side with your current version). Alas, I don't have … | |
Re: [B]scanf()[/B] and [B]cin[/B] tokenize on whitespace, so yes, they stop reading input at any whitespace. Please don't use gets(). [B]fgets()[/B] reads an entire line (it even returns the newline character at the end of the line), so if there are spaces in the line you'll get them too. The C++ … | |
Re: The best place to start is to get out a piece of paper and a pencil and figure out how you do it yourself. Once you know how to do it, step by step, you can tell the computer how to do it. When you have thought it out enough … | |
Re: IIRC, it worked just fine. You aren't seeing output because of the way Turbo C/C++ initializes the console output. The problem is that you are doing something wrong. Are you trying to get a directory listing? Or just show it to the user? | |
Re: The difference between an procedural and an object-oriented approach is how you bind the data and the functions that do something to it together. Right now you have a very good structure. You have [B]struct[/B]s that hold the data, and functions that operate on specific data. What you need to … | |
Re: ...and [inlinecode]main( void )[/inlinecode] is a C99 monstrosity. |