921 Posted Topics
Re: [QUOTE]I experienced it somewhat faster than IE and Firefox cos it's written entirely on the assembly language.[/QUOTE]Assembly is only faster than other programming languages (such a C/C++), if the programmer has the ability to optimize the code better than the C/C++ compiler, and recent compilers do this very well, so … | |
Re: The exact same would be: [CODE] if (tos==0) { // tos==0? return 1; // 1 } else { // : return 0; // 0 } [/CODE] But as you can see [CODE]return (tos==0?1:0)[/CODE] is much easier to write. | |
Re: You forgot the SND_FILENAME argument, change that line to:[CODE]PlaySound((LPCWSTR)"tone.wav", 0, SND_LOOP|SND_ASYNC|[B][COLOR="Red"]SND_FILENAME[/COLOR][/B]);[/CODE]and it should work. | |
Re: Don't kill me for this (I know this must be the worst idea ever), but WOOH! I figured it out! :D [CODE=CPLUSPLUS]#include <iostream> using namespace std; void addNodes(string names[]) { bool exception = false; size_t length = 0; string temp; do { try { temp = names[length]; ++length; } catch … | |
Re: I think its about time you learn to use code tags, even though you have already been told to use them before and ignored what was said. Try again with code tags.. | |
Re: A bit of an overkill don't you think? Also, your function can't handle negative numbers, mine can :D [CODE=C]string itos(int a) { if ( a == 0 ) return "0"; int sign = (a < 0 ? a = -a, 1 : 0); string result = sign ? "-" : … | |
Re: "[B]Weren't we the revolution that every night almost happened... almost happened... kept almost happening; but instead we just only crashed into eachother?[/B]" | |
Re: Here is an example of how to use the [B]GetOpenFileName[/B] function. Any decent Win32 tutorial on the net would should you how to do this, so in future, search the web.[CODE=CPLUSPLUS]#include <windows.h> #include <string.h> #include <iostream> using namespace std; // Returns an empty string if dialog is canceled string openfilename(char … | |
Re: Try this instead:[CODE=CPLUSPLUS]//empresas[i].nome_empresa = "a string"; strcpy( empresas[i].nome_empresa, "a string" );[/CODE] | |
Re: Assuming this is the defaut Windows API listbox.. Step 1: Find a handle to the window containing the list box. [URL="http://msdn.microsoft.com/en-us/library/ms633499(VS.85).aspx"][link][/URL] Step 2: Allocate enough space to hold the strings. eg.[INDENT][CODE]int count = (int) SendMessage( listbox, LB_GETCOUNT, 0, 0 ); std::string *items = new string[count];[/CODE][/INDENT] Step 3: Retrieve those values. … | |
Re: - Music geek - Japanese language / culture geek - Texting geek - Computer geek | |
Re: [QUOTE=marco93;811509]If its' on Windows, just use win32 api (1 line of code..)[/QUOTE] Go ahead then, tell us how to do it in one line. | |
Re: Some of my favourites: - [URL="http://www.imdb.com/title/tt0111161/"]The Shawshank redemption[/URL] - [URL="http://www.imdb.com/title/tt0880578/"]Untraceable[/URL] - The new [URL="http://www.imdb.com/title/tt0796366/"]Star Trek[/URL] | |
Re: We help with specific C++ problems here, we aren't going to think up a project for you. | |
Re: If you're using windows, try:[CODE=C++]#include <windows.h> #include <iostream> using namespace std; int main() { char szFileName[MAX_PATH]; HINSTANCE hInstance = GetModuleHandle(NULL); GetModuleFileName(hInstance, szFileName, MAX_PATH); cout << szFileName; cin.ignore(); }[/CODE] | |
Re: Well, a nice place to start is always here: [URL="http://www.winprog.org/tutorial/"]http://www.winprog.org/tutorial/[/URL] However without the resource editor, you have a few different options, you could download a seperate resource editor, write your own resource file, or just avoid it entirely. First thing's first, you need the code for setting up a small … | |
Re: >Use the recovery disc. Thats asuming he made one before the password changed. I once had the same problem, this worked for me (took alot of searching). [URL="http://pcsupport.about.com/od/toolsofthetrade/gr/pcloginnow.htm"]http://pcsupport.about.com/od/toolsofthetrade/gr/pcloginnow.htm[/URL] | |
Re: What's the big deal? If you just use a library, it's easy. [URL="http://johnwiggins.net/jwsmtp/"][link][/URL] This worked perfectly for me, and there's plenty more out there. | |
Re: Another more common method would be to just loop from the start to end, instead of from the end to the start. [CODE]for (unsigned short i = 0; i < n_elements; ++i) { array[i] = blah; }[/CODE] | |
Re: [B]GetDlgItemInt[/B] retrieves the value from the edit box and returns it as an integer, so long as you're using Win32 API this should work fine. | |
Re: Saving and loading maps coulden't be easier with C++ :) Say you have your map in a char array, this code would save that array to a bitmap.[CODE=CPLUSPLUS]#include <iostream> #include <fstream> int main() { char map[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, … | |
Re: Depends, if you mean using the Win32 API, then it's easily possible. AFAIK it's not possible to set the font size on the console through just using C++ code. | |
Re: [QUOTE]Well I would hate to spoil the surprise but everything we see in the real world is basically digital. Made of atoms and energy. Then when measuring objects we use measurements that only measure a group of atoms the the number of atoms in that group always varies. It is … | |
A small game of pong I put together in about half an hour :) Enjoy. | |
Re: A nice collection of funny images, here are some I found funny :] [URL="http://newmedia.funnyjunk.com/pictures/0009.jpg"]http://newmedia.funnyjunk.com/pictures/0009.jpg[/URL] [URL="http://newmedia.funnyjunk.com/pictures/0015.jpg"]http://newmedia.funnyjunk.com/pictures/0015.jpg[/URL] [URL="http://newmedia.funnyjunk.com/pictures/0016.jpg"]http://newmedia.funnyjunk.com/pictures/0016.jpg[/URL] [URL="http://newmedia.funnyjunk.com/pictures/0022.jpg"]http://newmedia.funnyjunk.com/pictures/0022.jpg[/URL] [URL="http://newmedia.funnyjunk.com/pictures/0023.jpg"]http://newmedia.funnyjunk.com/pictures/0023.jpg[/URL] [URL="http://newmedia.funnyjunk.com/pictures/0036.jpg"]http://newmedia.funnyjunk.com/pictures/0036.jpg[/URL] [URL="http://newmedia.funnyjunk.com/pictures/0044.jpg"]http://newmedia.funnyjunk.com/pictures/0044.jpg[/URL] [URL="http://newmedia.funnyjunk.com/pictures/0047.jpg"]http://newmedia.funnyjunk.com/pictures/0047.jpg[/URL] [URL="http://newmedia.funnyjunk.com/pictures/0049.jpg"]http://newmedia.funnyjunk.com/pictures/0049.jpg[/URL] [URL="http://newmedia.funnyjunk.com/pictures/0055.jpg"]http://newmedia.funnyjunk.com/pictures/0055.jpg[/URL] [URL="http://newmedia.funnyjunk.com/pictures/0063.jpg"]http://newmedia.funnyjunk.com/pictures/0063.jpg[/URL] [URL="http://newmedia.funnyjunk.com/pictures/0068.jpg"]http://newmedia.funnyjunk.com/pictures/0068.jpg[/URL] [URL="http://newmedia.funnyjunk.com/pictures/0073.jpg"]http://newmedia.funnyjunk.com/pictures/0073.jpg[/URL] And thats enough for now :) | |
Re: You should be more specific, what do you want your program to do? If it's to create a graph, your best bet would be to use a bitmap library. Here's a snippet I changed slightly so that you at least have a base to draw onto a bitmap. Actually drawing … | |
Re: A1: A towel? A3: A mole? Two random guesses. [B]If you have me, you want to share me. If you share me, you haven't got me. What am I?[/B] | |
Re: Explain what you mean by "GIF image into binary". I'm assuming you mean to get an actual array of pixels instead of having them in a compressed format, but the question seems vague. Marco93, if you want to play it that way, your post has no sense. GIF is an … | |
Re: [QUOTE]hey guys, emm can someone explain fast for me how to get to the programming state where u get a window with some options on the side and can then switch to code i cant remeber how to get there[/QUOTE]Huh? o.O if you want a good reply, ask a good … | |
Re: Congratulations, 3 posts in a row without using code-tags. | |
Re: This is a C++ snippet I made a long time ago, it's practically C and with some searching I'm sure you would have found it anyway. It's well commented so it should help you. [URL="http://www.daniweb.com/code/snippet217340.html"][link][/URL] | |
Re: I stopped most of my activity here a fair while before the big change, but now I have even less reason to come back, I totally agree with Jephthah, it's ugly and unwelcoming. The fonts are a mess, the colors are plain and dull, and everything seems to put strain … | |
Re: Look how old the thread is.. Read the rules!! | |
Re: Uhm... yes? Do you think you will live past the age of 80? :P | |
Re: Yep, almost all spaces (except those between keywords) are ignorable, so in the end the compiler would just see it as [CODE]int*a[/CODE] anyway. | |
Re: - Being a young kid, life just seemed so simple. :P - Some nice holidays, I remember going to elba (a small island in italy) which was quite memorable. [URL="http://media-cdn.tripadvisor.com/media/photo-s/01/1e/d5/b5/isola-d-elba.jpg"][link][/URL] - Finishing my GCSE's and leaving school (about 1 week ago), it's such a relief and now I'm on holiday. … ![]() | |
Re: [QUOTE]I envy those people who are the real legends in gaming world !![/QUOTE]I pity them, they're far from being "real legends" in the "real world" :icon_wink: Unless of course you're talking about the programmers. | |
Re: [B]>if my best friends dont get featured i am going to organize them to leave for a better c# forum where their skills are appreciated.[/B] Oh please, do you actually care about helping people or do you just want everyone to see you as somebody who helps people, there's a … | |
Re: >Aren't we supposed to just make 3 words from the word? Its more fun to make more :) Tired Direct Tied Rot Cot Cry Toe Record Dye Tide [B]Digital[/B] | |
Re: Post some code of what you have so far please. | |
Re: I think it makes sense, when somebody says "Given an infraction", I interpret it as "Being given an infraction point" - a quantity of how much a user how violated the rules. ![]() | |
Re: Hmm... 'be nice to my tall polish friend' 'beef never tastes minty to proper folks'?? my god, this is hard :D [B]tirenko[/B] | |
Re: What's happening to the standards of posts these days? :icon_rolleyes: Learn how to present a question, and try again. | |
Re: Post code so I see what you mean? When I have multiple window processes, I sometimes seperate them into different header files to stay organised. |
The End.