921 Posted Topics
Re: [QUOTE]Not only that but I will show you mathmatical properties of some parts of the english translated (aramaic) new testament that are so precise that they are outside of the ability of a normal human with a computer to concieve.[/QUOTE]I'm looking forward to that day... | |
Re: That's because you can not set the size of an array at runtime. If you want do this, research dynamic allocations using the [b]new[/b] keyword. | |
Re: C++ is case sensitive, so [b]class c : public A,b[/b] should be [b]class C : public A, B[/b] | |
Re: Pretty much all of your threads have had something to do with finding the CPU usage in different operating systems. I think you should find some multi-platform library to do this for you instead of figuring each one out yourself. | |
Re: It's a dangerous thing to do, but:[code=cplusplus]double *a = (double*)0x245CEA20; std::cout << (*a);[/code] | |
Re: Not another one.. [URL="http://www.daniweb.com/forums/thread139990.html"]http://www.daniweb.com/forums/thread139990.html[/URL] | |
Re: My most blurred key is the Caps-Lock, probably caused by a thick layer of dust that's built up over the years :P My most used key (and cleanest) is probably the space bar, seems logical as you use it at the end of almost every word. | |
Re: Do what you like the most, though if it were me I would start off with something lower level like C/C++ as it will give you a better understanding of computers in general. If you then want to move into a faster method of programming, learn something such as C# … | |
Re: Too slow? I just made a program which loads 60000 words, and it managed that in about a 1/10th of a second. Use simple file streams ([URL="http://www.cplusplus.com/doc/tutorial/files/"]std::ifstream[/URL]) and [URL="http://www.cplusplus.com/reference/stl/vector/"]vectors[/URL], and speed shouldn't be a problem. | |
Re: I heard on TV that she's "the most viewed person on the whole of the internet" She is very talanted, but I personally prefer [URL="http://www.youtube.com/watch?v=QWNoiVrJDsE"]Connie Talbot[/URL]. | |
Re: [B]>A Lot people says that Windows XP is much better than VISTA? why?[/B] No, it's not true. Many peoples opinion is that XP is better and more reliable than Vista, but I disagree. [B]>the files you created in Windows XP could not be opened if you use VISTA Operating System? … | |
Re: [B]>No, YOU write it![/B] Don't get carried away. I think he was just quoting his question, after all, he did say "Im not here for the codes but rather someone could spur me up so that i can kickstart." [B]>thrown 3 qns[/B] I guess that means questions, use good English … | |
Re: So, are you trying to make the puk bounce when it hits the top or the bottom? If so, simply invert the Y-Velocity like this:[code=cplusplus]if ( box.y < 0 ) { yVel *= -1; box.y = 0; } else if ( box.y > curLvlHeight - PUK_HEIGHT ) { yVel *= … | |
Re: I'm not sure if this is possible with Vista, there's probably already software available on the internet to do this, but if you planned on doing it manually, you need these 3 main things:[LIST] [*]To be able to disable all system hotkeys, so the internet explorer can't be closed. [*]Make … | |
Re: [QUOTE]It is always better to put the statements in if conditions in brackets. And start using else if's.[/QUOTE]Who says using brackets is better? IMO your code was harder to read than the original code. If it were me, I would have written it like this:[CODE=C]#include <stdio.h> int main() { int … | |
Re: [CODE]#include <iomanip> #include <iostream> using namespace std; #ifdef __GNUC__ #include <unistd.h> #endif #ifdef _WIN32 #include <cstdlib> #endif int main() { for (int units = 10; units > 0; units--) { cout << units; if (units < 1) cout << "\rBlast off!\n"; cout.flush(); #ifdef __GNUC__ sleep(1); // one second #endif #ifdef … | |
Re: [QUOTE=killdude69;879552]You shouldn't use a textfile, the user could just simply delete the text file or something. You could create the file in a hidden folder somewhere on the D: drive so the user could not find it, keeping your source code secure.[/QUOTE] Nah, a text file is fine, so long … | |
Re: [QUOTE=Narue;881164]>>...but #include "stdafx.h" is missing >Please note that it's not needed for non-Microsoft compilers It's not needed for Microsoft compilers either. :icon_rolleyes: I hate how they use that as a default include for generated code. That's one of the reasons I always create an empty project with Visual Studio instead … | |
Re: This code is unintelligible. I can't quite tell with the current formatting, but is that supposed to be an 8 - levelled for loop? Rewrite your code, using [ICODE]int main( void )[/ICODE] instead of [ICODE]void main()[/ICODE], and make sure it has a decent structure. Initialize your sudoku like this:[CODE=CPLUSPLUS]int sudoku[9][9] … | |
Re: If you want to compare the probability of whatever it is, you shouldn't use the [B]==[/B] operator, instead do... [code=cplusplus]if ( fabs(prob) - 0.5 < 0.001 ) { counter++; }[/code]You can change 0.001 to a precision of your choice. | |
Re: I would do this in C++. This is no easy task, you are talking about simlulating keystrokes to the window and making the program 'play the game' for you. In C++ you could either use [B]SendMessage[/B] or [B]keybd_event[/B] to simulate the keystrokes to the window. Getting the hardcoded data from … | |
Re: Is this you three years back? [URL="http://www.daniweb.com/forums/thread49252.html"][link][/URL] If so, maybe you could have googled your question, found that thread and rediscovered almost the exact same answer that's been given here. We aren't here to write code for you, only to help you get started. | |
Re: Is there any code you aren't posting? what is [B]FIND_NUM[/B] and [B]BIGGEST[/B]? You can't use [B]sizeof[/B] to work out the length of an array passed to a pointer, instead you have to allow the caller to pass the length of the array as a parameter. | |
Re: 1.22461e-16 is equal to 0.000000000000000122461, which is pretty close to 0 if you ask me. This is just caused by the precision of the [B]double[/B] type and how the data is stored. You could also round the number to remove that problem. | |
Re: An example...[code=cplusplus]// In Form1 code { Form2->mylabel->text = "Hello"; }[/code] | |
Re: Use code tags. You have given us nothing to go on here, does the compiler throw errors at you? Is the output wrong or not what you expected? Remember, a decent question gives a decent answer. | |
Re: Use a library to do that part for you, something like [URL="http://www.codeproject.com/KB/cpp/lint.aspx"]lint[/URL] for example. | |
Re: Read the comments on this snippet. [URL="http://www.daniweb.com/code/snippet1211.html"][link][/URL] | |
Re: main() is the start of any C++ application, why do you need to do it without it ? | |
Re: Open a file stream, and write the array to it. [URL="http://www.cplusplus.com/doc/tutorial/files/"][link][/URL] | |
Re: [code=cplusplus]while(!inFile.eof())[/code]Don't use eof() inside a loop like that, simply do what ArkM suggested and do this:[code=cplusplus]while ( inFile >> ascii ) { cout << (char)ascii; }[/code]Hope this helps. | |
Re: [QUOTE=iamthwee;877372]> Remember that it's still a part of C++ I'll agree with you on this, but where you can it makes sense to use c++ functions.[/QUOTE] Use what's easiest, while keeping an eye on performance and code consistency if possible. If a C solution is easier to program/understand than a … | |
Re: [QUOTE]Or read the following (IMO the best) free e-book about C++ programming: [url]http://msdn.microsoft.com/en-us/beginner/cc305129.aspx[/url] :)[/QUOTE]How unfair! I bought that book once, I never knew it was on msdn. :P | |
Re: If you are using the Windows API, you can do this in a few ways.[LIST] [*]Focus on the text box, and simulate keypresses. [*]Get the text box window handle, and set the text using [URL="http://msdn.microsoft.com/en-us/library/ms633546(VS.85).aspx"]SetWindowText[/URL] [*]... Probably more methods [/LIST]Hope this helps. | |
Re: >before that i need to send only few data There's a chance that this may have been his problem, not sure though. :P | |
| |
Re: There's a few small errors in your code, but overall you seem to have the right idea. Here is the corrected code:[CODE=CPLUSPLUS]#include <cstdlib> #include <iostream> #include <string.h> using namespace std; int main(int argc, char *argv[]) { string s1; int x = 0; s1 = "1020401"; int length = (int)s1.length(); for … | |
Re: Haha :D the age ratings generally dont make much difference, it mostly depends on the kid. I remember watching some sort of violent film (rated 15+), and there was a 7-8 year old kid sitting and laughing at it. Whereas my 8 year old sister had to leave Narnia (PG) … | |
Re: [QUOTE]never mind copying and pasting links for me.....all i wanna know is the answer for wat combination of calls can be used for reading binary file and sendin thro a socket.......i can try to put it in my code if i get some basic help......[/QUOTE]Your ungratefulness to people who are … | |
Re: [QUOTE]Then a zero value is returned, or am I wrong? [/QUOTE]You're wrong. If you pass a NULL pointer to [B]atoi[/B], your program will most lightly crash. If you pass a string such as "12Q34" then it will return [B]12[/B], as it stops as soon as it reaches the first non-digit … | |
Re: Careful where you are placing that code, the easiest option would be to find where it says:[CODE=CPLUSPLUS]/// Required designer variable.[/CODE] [I](line 49 for me on my default generated window)[/I] Then put any variables after that. Also, it's not usually a problem to declare it as a static variable, which should … | |
Re: Try using this code instead:[CODE=CPLUSPLUS]PictureBox ^pBox = gcnew PictureBox(); pBox->Parent = this; // 'this' is pointing to our form (the parent) pBox->Location = Point( 240, 210 ); pBox->Size::set( Drawing::Size(30, 30) ); pBox->BackColor::set( Color::Aquamarine );[/CODE]And as for making an array of [B]PictureBox[/B]s, this code will make an array that can hold … | |
Re: Here's a small snippet to turn on the Caps-Lock.[CODE=CPLUSPLUS]#include <windows.h> int main() { if ( !GetKeyState(VK_CAPITAL) & 1 ) { // If caps lock is off, simulate keypress keybd_event( VK_CAPITAL, 0, KEYEVENTF_EXTENDEDKEY, 0 ); keybd_event( VK_CAPITAL, 0, KEYEVENTF_KEYUP, 0 ); } return 0; }[/CODE]Hope this helps. | |
Re: I'm learning Japanese at a slow pace, mostly self-taught. Now than I'm leaving to go to college, I can't have my one japanese lesson per week at high school anymore. I'll probably get private lessons or keep myself motivated and continue learning by myself. I speak a fair amount of … | |
Re: [QUOTE=tux4life;870198]I think you aren't much with an enumeration like this, if your enumeration (the data type) hasn't got a name, then you should declare a 'variable' directly after it's definition (you don't have to do this, syntactically your example is correct, but if you don't do this it's pretty much … | |
Re: I changed the function prototype on line 32 of [B]_Double_Task.h[/B], and the actual function on line 224 of [B]_Double_Task.cpp[/B] to allow it to compile. Im not sure if this is what you wanted, but stuff happens and it compiles :P [B] [attach]10148[/attach] [attach]10149[/attach][/B] Hope this helps. | |
Re: Don't bother colouring your post green, it doesn't attract any wanted attention. For you this would be nearly an impossible task without the use of a third party library, so my advice is to do some good research on a library that can handle these video types. | |
Re: @ShadowScripter If you're new to this, using DirectDraw may seem quite complex, perhaps start on something easier? |
The End.