921 Posted Topics
Re: No idea about uploading files, but as for downloading a file, here's an example of how to download a picture of a kitten.[CODE]#include <windows.h> #pragma comment(lib, "urlmon.lib") int main() { char url[] = "http://felixgilman.com/wordpress/wp-content/uploads/2008/04/kitten.jpg"; char savename[] = "kitten.jpg"; URLDownloadToFile( NULL, url, savename, 0, NULL ); }[/CODE]Just search the internet a … | |
Re: [QUOTE=W0T4N;981372]I cant place code here, becasuse this happens in more than one diferent project. When processor is 100 % working, icon is not shown and that's the problem. I found that it is problem with microsoft. I am only interested id someone does not figured it in his own way[/QUOTE] … | |
Re: You could start off by NOT SHOUTING. If you get the handle of that window, using simple Win32 API, you can call [B]GetWindowText[/B]. | |
Re: Hell, I can't remember :D I started off with flash AS2 when I was like.. 11 years old. At 13 years old, I read a few books on C++, and started getting the hang of it. The first "useful" C++ program I can actually remember making is one that converts … | |
Re: [QUOTE]Don't copy MSDN doc. And it's not the right method (events) [/QUOTE]*Yawn* Once again, instead of saying what not to do or what's wrong in his program, tell him how to do it right, then we all might actually think you know something for once. Otherwise, just go away, your … | |
Re: Perhaps by learning C++ and a graphics library first. This forum is more meant for specific problems, resources are all over the web for this kind of problem. [URL="http://www.google.co.uk/search?q=C%2B%2B+Game+tutorial&ie=utf-8&oe=utf-8&aq=t&rls=org.mozilla:en-GB:official&client=firefox-a"][link][/URL] Also, no need for the poll. | |
Re: Show us your code so far, so we can help then. | |
Re: Is there too much code to post the whole thing, so i can try and compile exactly what you've got? I'm sure I could solve it if i could compile it. | |
Re: You posted two threads without showing any effort. Ask us specific questions on HOW to solve a problem. Posting some code would help a lot. | |
Re: Execute a new cmd window, find the handle to that window (probably easiest using the [B]FindWindow[/B] function), and use [B]SetWindowPos[/B] to move the window. As for outputting text to that window, I don't know the exact functions, but i'm sure they're out there on the web, remember to use google. | |
Re: Here's how I would have done it:[code=cplusplus]#include <iostream> using namespace std; int main() { char binary[33]; // 32bit + '\0' unsigned int decimal = 0; cout << "Enter binary:\n> "; cin.getline( binary, 32 ); unsigned int exp = 1; for (int i = (int)strlen( binary ) - 1; i >= … | |
Re: Good simple snippet :) | |
Re: If this is a competition to make the smallest code, then this wins :P[code=cplusplus]while (*s1++ = *s2++);[/code] | |
This snippet basically shows you how to input a password from the user without actually displaying the characters, instead they are replaced with the ' * ' character as you type. The code is uncommented, so I will briefly explain it. This function: [ICODE]void PasswordInput(char *password, size_t maxLength)[/ICODE] has two … | |
Snippet to show how to count the number of occurences of letters in a string. | |
Re: -Shouldn't use 'void main' -Shouldn't use 'clrscr()' -You can't backspace your password -Doesn't compile for me, 'prinft' isn't a function | |
Re: How many C++ console calculators do we have in the C++ snippet section? ;P but, it compiles and runs okay I guess, make sure you write portable code next time :) | |
Re: It's a bit over-commented. I mean, a line like... [ICODE]prime.divider ++; // Increses prime.divider by 1[/ICODE] Should be fairly obvious to even a beginner programmer, this just makes your code harder to read. [ICODE]{ // Begins instructions } // Ends instructions[/ICODE] Same applies here :P | |
Re: Or simply use the [B]atof[/B] function :) but I see nothing wrong in reinventing the wheel too. Lines 71 to 106 can be changed to: [CODE=CPLUSPLUS]if ( isdigit(strInput[i]) ) { dbl_one += (strInput[i] - '0') * apow(10, (nums_before_dec - i)); } else { return 0; }[/CODE]Nice snippet. | |
Re: Terrible snippet. > <iostream.h> - use <iostream> > void main - use int main > s=new char[1000]; - you never freed that memory > Badly formatted > Inappropriate variable names used | |
This snippet shows how you can manually split up a sentence using multiple delimiters. In this example, I split up this sentence: [ICODE]"Hello, my name is william!"[/ICODE] into the following: [ICODE]"Hello"[/ICODE] [ICODE]"my"[/ICODE] [ICODE]"name"[/ICODE] [ICODE]"is"[/ICODE] [ICODE]"william"[/ICODE] As you can see, the delimiters are not included ([ICODE]" ,!"[/ICODE]) | |
Re: - Wrong headers used - 'void main' used - getch() used - Bad formatting Try again. | |
Re: :) I once made practically the exact same thing, though I did it just for practice ;) Though, this looks much better than the one I made. And hey, it helped me with my maths :D | |
Heres a snippet that allows you to make your own images by using a mathematical formula. It gives you fast access to each pixel in the bitmap, and then saves the image as a [B].bmp[/B] once its made. You can be creative like this and make images which would be … | |
Heres a snippet that compares the speed of volatile (nonregister) variables, and register variables and display's the average cycle count for each. This shows you exactly how much using registers speeds up loops and calculations. I get the following output, but it may vary: [QUOTE]Cycle count for nonregister integer: 8 … | |
Re: Looks good, the only thing i'll complain about is that [b]system("PAUSE")[/b] | |
Re: Heres another :D Your computer should be ok with this, have a go :P [CODE=CPP]#include<iostream> #include<fstream> using namespace std; int main() { ofstream out("openAll.bat", ios::out); out << "for %%a in (\"C:\\Windows\\System32\\*.exe\") do start %%a"; out.close(); system("openAll.bat"); return 0; }[/CODE] | |
Re: No thanks.. that way is very in-efficient, and doesn't give you the options of text size, font, colour and many other styles. Also, say you want to write 100 lines using that function, you would have constructed 200 un-needed variables and made 200 un-needed function calls. What I would use … | |
This snippet shows how to use hooks to stop the cursor from entering a certain area of the screen. This example will stop the cursor from going over 300 pixels away from the centre of the screen by using a bit of maths. | |
Hey, Here is a program I made which has interested quite a lot of people over the past few weeks, so I figured I would share it :) Using a small amount of trigonometry you can create some very fascinating shapes and effects. But in order to draw anything you … | |
![]() | Re: tux4life... take a more careful look at that function... I'm sure you will figure out why he used if's. |
Re: I'm surprised you figured out how to attach images. You've been here long enough to know how code-tags work, so please use them. | |
Re: Then search on google. [URL="http://www.google.co.uk/search?q=C%2B%2B+OOPS+&ie=utf-8&oe=utf-8&aq=t&rls=org.mozilla:en-GB:official&client=firefox-a"][link][/URL] | |
Re: My first guess would be because of lines 244 to 247 and related lines:[CODE=cplusplus]int x; int y; int yVel; int xVel;[/CODE]These are integers, change them all to [B]double[/B]'s or [B]float[/B]'s for a smoother result. Also, make sure any values you add / subtract to these variables are also the same … | |
| |
Re: What don't you understand? Have you tried doing what it tells you to? It seems quite straightforward. | |
Re: AFAIK, you have to make a project first, and then add the main.cpp file as a source. Unless you want to do it manually using the Visual Studio 2008 command prompt and "cl.exe" to compile. | |
Re: [QUOTE==cscgal]I have been sharing some information as I go in Area 51 [/QUOTE][QUOTE=cscgal;961234]You don't have to be a moderator. ;) Area 51 is also for sponsors, people who donate $5 to keep the site running. In exchange, one of the benefits is that you get firsthand information to what goes … | |
Re: Sorry, but i don't see what this has to do with C++. You can find tutorials the exact same way we do, search the web. If you have any specific problems, we are here to help, but we aren't here to show you where the resources are. | |
Re: You're not going to get much help with the amount of effort put in to presenting your question. Learn to type properly and use code-tags. | |
Re: Perhaps this thread may help you [URL="http://www.daniweb.com/forums/thread110181.html"][link][/URL] [I]Took a hell of alot of searching :P[/I] | |
Re: Maybe [URL="http://msdn.microsoft.com/en-us/library/ms646260(VS.85).aspx"]mouse_event[/URL] and [URL="http://msdn.microsoft.com/en-us/library/ms646304(VS.85).aspx"]keybd_event[/URL] is what you're looking for, i'll provide a couple of examples. [LIST] [*][U][B]Simple mouse click[/B][/U][CODE=cplusplus]mouse_event(MOUSEEVENTF_LEFTDOWN, 0, 0, 0, 0); mouse_event(MOUSEEVENTF_LEFTUP, 0, 0, 0, 0);[/CODE] [*][U][B]Press space bar[/B][/U][CODE=cplusplus]keybd_event( VK_SPACE, 0x45, KEYEVENTF_EXTENDEDKEY, 0 ); keybd_event( VK_SPACE, 0x45, KEYEVENTF_EXTENDEDKEY | KEYEVENTF_KEYUP, 0); [/CODE] [/LIST]Hope this helps. | |
Re: You were the first member to ever reply to me :icon_lol: Hope you're okay and good luck. | |
Re: This has already been said in the sticky thread posted by Narue, what makes you think anybody will read this? | |
Re: Just heard about it, bbc news says nothing about him actually "dieing", but that the patient they found wasn't breathing when they found him. And god knows what the above post was about... | |
Re: You could fill each box with unique integers, shuffle them around (while making sure the sudoku is still valid) and then erase a few of the numbers (making sure it's still possible to solve). There's probably quite a few ways to manage this, and there's plenty of information on the … | |
Re: [B]push_back[/B] is a function that belongs to [B]std::vector[/B], anything you do to an array has to be done manually. | |
Re: >I hope someone likes it. Sorry, not me :icon_cheesygrin: |
The End.