- Strength to Increase Rep
- +9
- Strength to Decrease Rep
- -2
- Upvotes Received
- 33
- Posts with Upvotes
- 28
- Upvoting Members
- 21
- Downvotes Received
- 2
- Posts with Downvotes
- 2
- Downvoting Members
- 1
- Interests
- Programming
Re: 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 … | |
Re: [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? | |
Re: [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. … | |
Re: 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 … | |
Re: [url]http://faq.cprogramming.com/cgi-bin/smartfaq.cgi?answer=1046996179&id=1043284385[/url] | |
Re: Also see this FAQ: [url]http://faq.cprogramming.com/cgi-bin/smartfaq.cgi?answer=1048865140&id=1043284351[/url] | |
Re: 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 … | |
Re: 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. | |
Re: 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 … | |
Re: 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 … | |
Re: 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 … | |
Re: 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". | |
Re: 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 … | |
Re: 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 … | |
Re: 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 … | |
Re: 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 … | |
Re: If you don't care what the beep sounds like just print a '\a' character. [code]cout << '\a';[/code] or [code]putchar('\a');[/code] | |
Re: 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. … | |
Re: 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 … | |
Re: 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 … | |
Re: 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] … | |
Re: 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 … | |
Re: 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\", … | |
Re: 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 … | |
Re: 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 … | |
Re: I'm also thinking that this [code]string todo = "/.todo.txt"; [/code] should be "./" instead of "/.". | |
Re: [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 … | |
Re: [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 … | |
Re: [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) { … | |
Re: 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 … |