Posts
 
Reputation
Joined
Last Seen
Ranked #224
Strength to Increase Rep
+9
Strength to Decrease Rep
-2
94% Quality Score
Upvotes Received
33
Posts with Upvotes
28
Upvoting Members
21
Downvotes Received
2
Posts with Downvotes
2
Downvoting Members
1
17 Commented Posts
0 Endorsements
Ranked #505
~96.6K People Reached
Interests
Programming
Favorite Tags
c++ x 156
c x 99
perl x 5
java x 4

218 Posted Topics

Member Avatar for Zcool31

Did you try google? There seem to be a lot of hits relating to this. [url]http://www.google.ca/search?q=sdl_ttf+opengl[/url] You can use SDL_ttf's TTF_RenderText_Blended to get smoothed SDL text surfaces. I don't know how to convert them for use in OpenGL from there, unfortunately. I think you should be able to find this …

Member Avatar for BeautyBeast
0
1K
Member Avatar for AJones

[code] getchar(); }[/code] [url]http://faq.cprogramming.com/cgi-bin/smartfaq.cgi?answer=1043803465&id=1043284385[/url] [url]http://faq.cprogramming.com/cgi-bin/smartfaq.cgi?answer=1042856625&id=1043284385[/url] [quote]. . . I use the example Hello.dev from Examples directory soon after installation. How would I get this working from command line.[/quote] So, you have a .dev file that you want to compile from the command line?

Member Avatar for Wajid sardar
0
2K
Member Avatar for bops

[quote]you might also check the length of the PATH environment variable. On my computer it's so long that there isn't any room left to add more. So I have a batch file to truncate the PATH to bare necessity so that I can run other command-line programs from command prompt. …

Member Avatar for muhammad raees
0
29K
Member Avatar for MadnessCow

Declaring variables inside for loop initialization sections is indeed C99-only. I wouldn't do it if I were you. [quote]Btw, what are the differences between float and double? [/quote] double just has more precision (usually). Oftentimes, a float is 4 bytes and a double is 8. There used to be a …

Member Avatar for Adak
0
6K
Member Avatar for Coach_Nate

[url]http://faq.cprogramming.com/cgi-bin/smartfaq.cgi?answer=1046996179&id=1043284385[/url]

Member Avatar for rubberman
0
261
Member Avatar for Majoni

Also see this FAQ: [url]http://faq.cprogramming.com/cgi-bin/smartfaq.cgi?answer=1048865140&id=1043284351[/url]

Member Avatar for gourav1
1
365
Member Avatar for johnray31

Your code is actually C. You're not using any C++-specific features. That's not necessarily a bad thing, just thought you should know. :) If you want to stick with C-style functions you might find strncmp() useful instead of comparing individual elements of a char[] array. You should probably also make …

Member Avatar for dwks
0
134
Member Avatar for lotsofsloths

As for keeping score, you could have two variables. [code]int games_won_by_computer; int games_won_by_player;[/code] Once you're done that game, you could try a guessing game where the user guesses a random number in as few tries as possible.

Member Avatar for ichigo_cool
-1
1K
Member Avatar for Mona..

Well a start would be to change the <= on line 13 to >=. But then you still get weird output. I'm not sure how exactly you want to break this problem down recursively. You could have one function for each line, as you're doing, but then you need to …

Member Avatar for Mona..
0
968
Member Avatar for SoulMazer

You could try here: [url]http://chrishecker.com/Rigid_Body_Dynamics[/url] I've never done this, but my intuition would be this. Gravity is applying a downward acceleration on the box; this amounts to a force applied directly downwards starting from the object's centre of gravity (for a box, this is just the centre). You can calculate …

Member Avatar for dwks
0
133
Member Avatar for minskypooh

This doesn't actually print anything. [code] if (n >= 95 && n <= 100) //print corresponding letter grade string m = "A+ ";[/code] Also, you can't just assign a string like "A" to the member variable grade, as I suspect you tried to do, since grade is an int. I'd …

Member Avatar for minskypooh
0
199
Member Avatar for Deepak20

Probably args[0] doesn't exist. This is the array of arguments passed to the program, so perhaps when you run the program with "java Sha" you should add whatever args are required, as in "java Sha arg1".

Member Avatar for Deepak20
0
208
Member Avatar for ayesha91

As mentioned, the issue is that the memory you allocated previously with [inlinecode]new int[inter][/inlinecode] is still an array with zero elements when you try to use it with [code]intersection[a] = elements[a];[/code] A slightly hackish and wasteful way around this would be to allocate size+s2.size elements for intersection (since that's the …

Member Avatar for dwks
0
169
Member Avatar for lochnessmonster

Do the functions isValidProcess() and isValidfile() throw exceptions if they find something amiss? It should do no harm to set this->fileName, which is just a string, to fileName, and then do the check afterwards. If the check fails you can always reset the variable. Why do you want to use …

Member Avatar for dwks
0
91
Member Avatar for Katya

Use code tags when you post code -- otherwise it will be an unreadable mess. This is also the C programming forum, not the C++ one, so C++ code is out of place. It's also old-style C++ code. You're using <iostream.h> and <fstream.h> etc, which are pre-standard. Use <iostream> and …

Member Avatar for alekhya.p123
0
541
Member Avatar for Fzn10

If the compiler isn't provided with a function definition or prototype at the point the function is called, it will say something like [code]warning: implicit declaration of function `foo'[/code] and if you pass it arguments [code]warning: too many arguments to function `foo'[/code] and various warnings if you use a return …

Member Avatar for sruthivin
0
101
Member Avatar for jan1024188

If you don't care what the beep sounds like just print a '\a' character. [code]cout << '\a';[/code] or [code]putchar('\a');[/code]

Member Avatar for +_+man
0
394
Member Avatar for Mobius1234

You may need to sort the data by number first, if that's the output you want. I think, however, that you should be reading in a sequence of names, assigning a number to each name automatically: so the first name entered will become 1, the second 2, and so on. …

Member Avatar for onaclov2000
0
119
Member Avatar for explorepython

The signal itself has to emit an argument if you want to connect it to a slot which accepts an argument. Otherwise, you need an intermediate function which adds the parameter in and then calls the appropriate slot with an argument. At least, this is to the best of my …

Member Avatar for explorepython
0
1K
Member Avatar for johnyjj2

Mandriva, like most flavours of Linux, has a cairo package that you should be able to install with ease. [url]http://www.google.ca/search?hl=en&source=hp&q=mandriva+cairo+package&btnG=Google+Search&meta=&cts=1262806955486&aq=f&oq=[/url] The only time you really need to install something from source or from a third-party website is when it's really unusual software that there is no package for, or when …

Member Avatar for johnyjj2
0
220
Member Avatar for hdef

Also, this (starting at line 132) won't do what you want it to. [code] while(!opFile.eof()) { getline(opFile,templine); cout << "\nTEMPLINE: " << templine; //if ((offset = line.find(search, 0)) != string::npos) { // cout << "found '" << search << "' @ offset " << offset << endl; //} } [/code] …

Member Avatar for hdef
0
150
Member Avatar for Hatem Faheem

Well, first of all, the whole if-statement only executes if [icode]E1.loc == E2.loc[/icode], which I'm assuming means that the elevators are at the same position. I'm not sure whether this is what you want. Next notice that your code has some conditions when it does nothing. Suppose, for example, that …

Member Avatar for dwks
0
117
Member Avatar for lrh9

My own personal flavour of a quine. It's not the prettiest, I haven't used Python in a while. :) [code]#!/usr/bin/python import sys before = "#!/usr/bin/python\nimport sys\nbefore = \"" after = "def escape(string, multiline = False):\n\ string = string.replace(\"\\\\\", \"\\\\\\\\\")\n\ if not multiline:\n\ string = string.replace(\"\\n\", \"\\\\n\")\n\ else:\n\ string = string.replace(\"\\n\", …

Member Avatar for dwks
0
162
Member Avatar for Silvershaft

I have never used SFML, so I can't say anything about that. But I can highly recommend the SDL: it's a great library. If you're just starting to learn it, you really should check out this tutorial, it's one of nicest out there: [url]http://lazyfoo.net/SDL_tutorials/index.php[/url] [edit] The SDL has good multiplatform …

Member Avatar for Silvershaft
0
582
Member Avatar for johnray31

Again, don't use <iostream[b].h[/b]>. Plus main() returns [b]int[/b]. Don't cast malloc() (in C; in C++ you should use [inlinecode]new[/inlinecode]). And be sure to free() (for malloc()) or delete (for new) your memory. [code] #include<iostream.h> #include<stdio.h> [color=red]#include<conio.h> #include<alloc.h>[/color] [/code] In C++, <stdio.h> should become <cstdio>. And the last two headers you …

Member Avatar for vibhu1
0
233
Member Avatar for pymatio

I'm also thinking that this [code]string todo = "/.todo.txt"; [/code] should be "./" instead of "/.".

Member Avatar for Ancient Dragon
0
236
Member Avatar for Belthemet

[QUOTE=Belthemet;966506][B]#Off topic[/B] When I was logging in, I have noticed 600,00x members registered on this forum. Congrats on the 600k! ;)[/quote] Yes, new members register at an astonishing rate here . . . when I logged in there were six less members than there are now. :) [quote]Hello. My console …

Member Avatar for Belthemet
0
261
Member Avatar for stromgren

[url=http://www.instant-registry-fixes.org/troubleshooting-and-preventing-ntdlldll-errors/]This page[/url] says that ntdll.dll is "a Native API file of Microsoft operating systems and it contains NT kernel functions". Kind of vague, but perhaps if the code is doing any system calls (accessing files, perhaps), that may account for it. Or perhaps if your program uses a lot of …

Member Avatar for stromgren
0
363
Member Avatar for Joe Shmoe

[code]char filenames[fcount][16];[/code] You're declaring a variable-length array here. It's not standard C89 to do that. If I were you I'd just declare the array as [code]char filenames[MAX_FCOUNT][16];[/code] Also: [code] //Loop through the file names for(i = F_SIZE + 4; i < F_SIZE + 4 + (fcount * 16); i+=16) { …

Member Avatar for Joe Shmoe
0
148
Member Avatar for Aprentchacker

You use -99 in your input file to indicate end of line, but you seem to expect -999 in your program . . . . Just a thought: why don't you read in one line at a time, and treat that as the row of a matrix. That way you …

Member Avatar for Aprentchacker
0
170
Member Avatar for MaestroRage

You can't assign anything inside a structure declaration. A structure declaration just defines a type. It's like a blueprint; you're telling the compiler, "if I ask you to create a Something, this is what I want it to look like." An example of a structure declaration would be [code]struct Something …

Member Avatar for MaestroRage
0
138
Member Avatar for seemant_sun

Well, it has one advantage over a return value -- you have to pass in an address, whereas you could ignore a return value. :) I don't think that's how I would write it, though.

Member Avatar for Ancient Dragon
0
137
Member Avatar for osmano807

Too bad you're not using PHP. :) [url]http://ca2.php.net/filesize[/url] But it seems like it might not be possible: [url]http://bytes.com/groups/php/595984-filesize-not-reading-http-pages[/url] On the other hand, wget determines file sizes. Apparently it requires HTTP 1.1 (not 1.0) to do this. I really don't know. You'd have to do some research.

Member Avatar for osmano807
0
1K
Member Avatar for alka123456

Well, that's not too difficult. You could open the file, read it line-by-line, and print only those lines which contain the word "WARNING", for example. If you wanted to be more robust, you could separate out the column and compare that. Some code that may help: [code]std::string text = "A …

Member Avatar for NathanOliver
0
239
Member Avatar for daino

A constant variable can't be changed after initialization. If you didn't initialize it, too bad, you still can't change it. (If you compiler is a good one, it may warn you that you haven't initialized a constant variable.) In other words: "const" doesn't mean, "I'll only set this variable once." …

Member Avatar for dwks
0
165
Member Avatar for sidrah
Member Avatar for Mike Savino
0
159
Member Avatar for meabed

[code]for( int i = 0; i < [color=red]32[/color]; ++i )[/code] That's not very portable. Use something in <climits> or the C++ equivalent.

Member Avatar for Lisa1110
3
1K
Member Avatar for Clockowl

My only suggestion is to try a profiler so that you can see exactly where your program is spending all of its time. If you have access to the code from the other program, profiling it as well might be enlightening. If you're using a Windows port of GCC like …

Member Avatar for veelck
0
1K
Member Avatar for trick

Why is root a global variable? As far as I can see, it doesn't need to be, and it's just causing confusion because several functions take a root parameter.

Member Avatar for dwks
0
431
Member Avatar for loimarie

Why don't you use the [url=http://en.wikipedia.org/wiki/Quadratic_equation#Quadratic_formula]quadratic formula[/url]? If all of the equations are quadratic, it should work. You can do square roots in C with the sqrt() function from math.h, and arbitrary powers (if you wanted to) with pow(). The first part of the problem, of course, is parsing the …

Member Avatar for loimarie
0
160
Member Avatar for Prm753

[code] while ( !feof(ep) ) { fgets(registryHive, MAX_PATH, ep); [/code] Note that this is [url=http://faq.cprogramming.com/cgi-bin/smartfaq.cgi?answer=1046476070&id=1043284351]not a good idea[/url]. My suggestion: [code] while ( fgets(registryHive, MAX_PATH, ep) ) { [/code] Yes, it does the same thing. :)

Member Avatar for ArkM
0
150
Member Avatar for coolkeg

You don't want a semicolon after a while loop: [code]while( number<= 0 )[color=red];[/color] {[/code] -> [code]while( number<= 0 ) {[/code]

Member Avatar for Aia
0
138
Member Avatar for plike922

[code]if(fib = fnum) [/code] Try ==. = is for assignment, == is for comparison. (Your compiler should warn you about this if you enable warnings.) Plus I don't think this is what you want. [code]for (fib=1; fib=num2 + 1; fib++) [/code] The comparison portion of that for loop is actually …

Member Avatar for Aia
0
113
Member Avatar for sreesai

You can even use fancy preprocessor macros and so on to replace the malloc()/free() calls in existing code with your own functions. BTW, __LINE__, __FILE__, __DATE__, and __TIME__ are all standard C89 as far as I know.

Member Avatar for dwks
0
129
Member Avatar for mehtaneha84

The best way to do this is perhaps this: declare a structure representing the information. (Perhaps a header structure, a data one, a tail, and a packet structure that contains all three.) If you want to skip a given number of bits, use an unnamed bitfield. [code]struct { unsigned : …

Member Avatar for mehtaneha84
0
473
Member Avatar for NickyU

[code]What? Never heard of that. Don't tell me, this don't work x = bool (x||y) ; [/code] That is C++ only. The C way looks like this. [code]x = (bool)(x || y);[/code] Perhaps the OP is compiling as C instead of C++. As for the original code, it would work …

Member Avatar for NickyU
0
249
Member Avatar for ramesh54

You can read from and write to the same file at once, but it's difficult. You're best off creating a copy of the file and modifying that, then replacing the original file with the modified one, as you've done. You could definitely simplify the code by creating a function which …

Member Avatar for dwks
0
97
Member Avatar for gangsta gama

Use code=c++ in your code tags to get syntax highlighting. It makes the code a lot easier to read. iostream.h doesn't actually exist (according to the C++ standard). Consider using [code]#include <iostream> using namespace std;[/code] instead. Anyway. The problem is that you're writing a lot of numbers to a text …

Member Avatar for dwks
0
220
Member Avatar for xlx16

What are you forgetting here? [code]for(j=0;j<41;j++) for(i=0;i<79;) txt[j][i]=32;[/code] Hint: it's an infinite loop . . . . [edit] And it's a lot easier to use character constants like ' ' and '\r' in your code instead of magic numbers like 32 and 13, don't you think? [/edit]

Member Avatar for ssharish2005
0
137
Member Avatar for plike922

You could save the numbers as you find them instead of printing them, say in a char array, and then print that array in reverse. On the other hand, it would probably be better to use a different algorithm. What you need to do is find the most significant (highest …

Member Avatar for dwks
0
357

The End.