- Strength to Increase Rep
- +7
- Strength to Decrease Rep
- -1
- Upvotes Received
- 64
- Posts with Upvotes
- 56
- Upvoting Members
- 25
- Downvotes Received
- 23
- Posts with Downvotes
- 17
- Downvoting Members
- 11
- Interests
- C++, Java, J2ME, JAVA Swing, JavaScript, PHP, AMXX, DHTML, Video Editing, Poetry, Digital Imaging, Art,…
209 Posted Topics
[QUOTE]please give me the solution of reversing number 523 into 325 by using for loop[/QUOTE] What did you think the posts above were trying to do, exactly?
try changing the values of delay(int) in Snake::Move();
[U]we can[/U] does not imply [U]we have to[/U] First 2 is the only EVEN prime. Your program mentions it as Not Prime. Second unnecessarily checking torf for 1, when torf is just a replacement for boolean flag. You can pretty much use it as [CODE]if(torf)[/CODE] Third your program can make …
[QUOTE]oh i got it....thank.[/QUOTE] In that case mark this thread as solve, please.
[QUOTE]Can anyone tell me how can I install Turbo C++ on my computer.[/QUOTE] You can't without some hassles. Luckily, my friend faced a similar situation & I obliged him. You have to do follow the following: a) Install [URL="http://downloads.sourceforge.net/project/dosbox/dosbox/0.74/DOSBox0.74-win32-installer.exe?use_mirror=space"]DosBox[/URL] b) Run my app & set Targets to TC & DosBox …
[QUOTE] [CODE] string = (char*)malloc(strlen(str)+1); [/CODE] [/QUOTE] But my dear friend, Index starts from 0, so 0-11 is infact 12. So the OP's method is correct minus the typecast part.
Why not just sort the linear array by an algorith of choice (bubble, quick, etc.) then fill the 2-D array like that? If you hate the temporary array, then just apply selection sort and swap with the indexes starting from `rr[Len/2 -1][Len/2 -1]`
Try this: pattern = (?P<data>[+\-]?(?:(?:\d+\.\d+)|\w+))|(?P<garbage>.) for m in re.finditer(pattern, garbled_text): print m.group('data'), m.group(garbage) # m.groupdict() will also work
@pansquare, pyTony has provided the correct answer. However you seem to be not bothering to search the documentation on docs.python.org. s.partition(sep) returns a tuple which essentially is a set of 3 values (before, separator, after) `'foo[baz]bar'.partition('[')` returns a tuple `'foo', '[', 'baz]bar'` -> `(before, _, after)` `after.partition(']')` returns a tuple …
Need to see the code, but I'm guessing you messed up ImageStrech option of PictrueBox.
AFAIK Python stack/queue operations are done as: [CODE] l = list() # [] also works l.append(8) # Equiv. to push value = l.pop() [/CODE] Also your isMatching() function matches <head> with </body>. What you need is [CODE] def isMatching(tag1, tag2): return openTag(tag1) and not openTag(tag2) and tag1 == tag2.replace('/',''): [/CODE]
You can just load a dict() & print it. [CODE] foo = {"alice" : "A+", "smith" : "A", "daemon" : "B+", "lily" : "B" } print foo [/CODE]
[code] temp1=head; // temp1 = Head of list while (temp1->next!=NULL) { // Iterate till the last node (i.e., next != NULL) temp1=temp1->next; } temp->next=NULL; temp1->next=temp; // Add node to end. head=temp; // Head is the last added node! WHAT? [/code] 1. You are adding nodes to the end, not the …
[QUOTE]Though could you tell me about problem on the style and code of programme..[/QUOTE] I hope you do happen to know that BGI Graphics are deprecated and obsolete. 16-bit DOS compilers shouldn't even be allowed to compile. Don't get it why schools still teach this stuff.
Well this would just be my opinion. 1. Fill a Box 3x3 2. Move 2 Next Box's 1st column. 3. Create 3 arrays/vectors ___a. For that Box ___b. For Horizontal Line ___c. For Vertical Line 4. Select a random number & test to ensure it doesn't exist in any of …
Try the [URL="http://en.wikipedia.org/wiki/Harmonic_series_(mathematics)"]sine series[/URL].
First try saving that file in Notepad with UTF-8/16/32 encoding, if you can really save them, then Unicode supports you req. char-set & there shouldn't be any problem reading it in binary form & displaying it(requires a font).
@OP You are assigning values to locals. In your operator func. the LHS is your "this" pointer. You should be assigning to [COLOR="Green"]this->h & this->w[/COLOR]; >>you also have to explicitly call the base class' operator =() Nope. The default assignment operator(which shouldn't have been there in first place in C++) …
You do realize you can only instantiate like [CODE]int arr[]={9,0,...,6};[/CODE] only upon declaration. Anything other than that, use a parameterized ctor. Instead you should alloc memiry to data inside the createNewBox() [CODE]data = new box(maker, height, width, length, 0.0);[/CODE]
The best way is to call a post order traversal. Left->Right->Root [CODE]void DeleteAll(Node *myNode) { DeleteAll(myNode->LeftChild); DeleteAll(myNode->RightChild); delete myNode; }[/CODE] The above function is really post-order traversing but instead of just displaying we are deleting the value as well.
A Syntax Highlighter. I'm pretty sure it's not yours. strchr() is defined in string.h/cstring
If you manage to build a working browser just out of STDIO & CONIO, Einstein will walk this land once again. FYI: stdio = Standard Input Output conio = Console Input Output does that strike a bell? As for a browser try looking into Indy. Winsock2.h will help you, but …
In your push function: [CODE]while(isfull())[/CODE] It should be [CODE]while([B][COLOR="red"]![/COLOR][/B]isfull())[/CODE] Silly mistake. Happens to all.
>>Why this is 4 ? Because it's a ULONG type. A pointer stores Memory addresses, which in turn is stored as an unsigned long.
Echoing with peter_budo, J2ME has no file locking mechanism. It however has a file hiding mechanism (javax.microedition.io.file.FileConnection)
You really only have to include glu & glut headers making sure you have the required libraries.
[B]>>Does VC++ Express 10.0 even support the ability to get text from a text box?[/B] Ask yourself, what's the use of a write-only text box. [CODE] CText myText; CString text = myText.Text; //Property //Go berserk with text. [/CODE] In case I wasn't clear - Yes.
[B]>>Can anyone tell me why variables can have printed values of -858993460.[/B] Ever heard of "Garbage In, Barbage Out"? (pun intended) [B]>>Is it the size in bits of memory created for an int?[/B] No, it can be *any* data left in the memory. Data is stored as binary in memory. …
After n*n iterations, duh. (n is order). This is when you've read all the elements in the matrix.
The only problem I see is that you're too lazy to do your homework. Other than that it's pretty straight forward using the [URL="http://en.wikipedia.org/wiki/Binomial_theorem"]binomial expansion[/URL]: [B](x+y)^n = nCr x^(n-r).y^r[/B]
FTR: > Mar 25th, 2006 [OP] > Jul 27th, 2007 (Resurrection #1 by tformed) > Oct 12th, 2010 (Resurrection #2 by ssahmed)
[CODE] fstream file; file.open("foo.bar","r"); string str; while(getline(file,str)) //Read lines until getline() returns NULL at EOF. { //Read a line //Do something } file.close(); [/CODE]
You do realize that all you are doing is to print the values from 0 to x, where x = 2^k, k being a positive integer. firstPerson posted a recursive algorithm which however only prints binary once. The correct recursive algorithm to print numbers from start(0) to end(x), would go …
PostMessage will send the message to the hWnd not to the button. To make myself clear, consider this: PostMessage can send keys to an inactive window. And IIRC the 2nd arg to keybd_event() is I guess the Scan key code.
I agree with Fbody, however I believe there is more graceful way to say(read: teach) "Ooh you created a dangling pointer, hence the program will crash!". [CODE] try { delete [] pointer; cout << "called destructor for WrapArrayShallow" << endl; } catch(...) { cout << "Dangling pointer. Error deleting." << …
[CODE]int val_arr[5][5]; int i=0; while (file) { string str; int j=0; while (getline( file, str, '\t' )) var_array[i][j++] = ( atoi(str) ); i++; } //User val_array[][][/CODE]
[URL="http://msdn.microsoft.com/en-US/library/yt32ce9h(v=VS.80).aspx"]GetTime()[/URL] with Format().
You narrowing the double really beats the purpose of the program. Note that a triangles having 90.5 degree angle can never be right-angled, yet your program will show it to be right-angled. While comparing int with double you should try typecasting int to double. Some compilers will do that by …
What's the problem? No window showing up? Mouse Listener not in place? No Repainting?
Here's one place where I think Macros will be useful.
No. But I think there are some API functions something like SHOpenDirectory() for it. (SH standing for Shell - you concerned task).
Taking the list to be a singly ended. 1. Locate End Pointer (endPtr) 2. Create a new node (newPtr) 3. Initialize new node 4. Assign the link part of endPtr the address of newPtr 5. Make newPtr as new endPtr
If you wish to play music there are 2 ways possible: Windows PlaySound() : Works only for .wav MMSYSTEM mciSendString(): Works for midi & mp3 Photo's can also be read just like normal file's & barring their header information I don't see what you can make of it, since you …
[CODE]const int Pi = 3.14; //Constant int toDeg(int rad) { return rad*180/Pi; } float x = 0.3f*Pi; // x = 0.3PI int n = 10; // n = 10 float valOrig = cos(toDeg(x)); //To degree from radian float valComp = 0.0f; //Compute this value float Es = (0.5 x pow(10,2-n); …
A [B]Solved [/B]similar thread [URL="http://www.daniweb.com/forums/post1253476.html"]here[/URL].
Just like cout we ave std::cin & the >> operator [CODE]int foo; cin >> foo[/CODE]
1. TC is an awful thing from the past. Not only is it non-standard but it builds 16-bit executables which fail to work on the now-familiar 64-bit architecture. 2. There are GCC & MSVC 3. Latest Technology?? 4. Borland ceases to launch it's compilers but launches IDEs. It's acquired by …
The End.