299 Posted Topics
Re: I'm not entirely sure what you're trying to do, but I took a guess: #include <iostream> #include <iomanip> using namespace std; int main () { // variables double salary = 0.0; int RATE = .03; //Why is this an integer? Integers don't have decimals. // enter salary cout << "Salary … | |
Re: Try Allegro 5 or SFML 1.6. (SFML2 is nearing completion.) Program a bouncing ball. Then, program a VERY SIMPLE Tetris clone. After that, look into scripting languages. Start simple. Read in a file that says something like: show background.jpg show hero.png play music.mp3 print "Hero Game by Techy23!" Go from … | |
Re: Have you tried 3D matrix transforms? http://www.fastgraph.com/makegames/3drotation/3dsrce.html | |
Re: YOUR. CODE. IS. BROKEN. Read the comments in the code. It's designed to fail. In my fully updated MinGW/MSYS install, I compiled it. Note the name I gave it. dean@stormbringer /c/Workspace/C++/DaniWeb $ g++ -std=c++11 FOR_73H_LULZ.CPP FOR_73H_LULZ.CPP: In function 'int main()': FOR_73H_LULZ.CPP:22:14: error: no match for 'operator==' in 'a == b' … | |
Re: ***Madness?*** # THIS IS DANIWEB!! # Here are a few guides to help you out. http://www.cs.virginia.edu/~evans/cs216/guides/x86.html - Look at the table on the first page. Then jump to the next link. Jump back when the register functions make sense. http://www.eecg.toronto.edu/~amza/www.mindsec.com/files/x86regs.html - This gives an overview of which registers do what. | |
Re: Are you familiar with [B]stacks[/B]? A [B]stack[/B] is a data structure that is accessed only by it's last element. The simplest [B]stack[/B] is made with an array and a "top" index. When you start, you can set the top index to zero. To add data to the [B]stack[/B], you "[B]push[/B]" … | |
Re: Here's a hands on example. (A good reference to look at first:) http://stackoverflow.com/questions/1395591/what-is-exactly-the-base-pointer-and-stack-pointer-to-what-do-they-point I modified the C code a little: int foo=1; int main(int argumentCount, char *arguments[]) { const char* bar = "Hello, Daniweb!"; char *firstArg; int num; num=1; num=argumentCount; num=0; firstArg=arguments[1]; firstArg=(char *)0; return num; } I compiled using … | |
Re: Ref: http://msdn.microsoft.com/en-us/library/windows/desktop/ms681944(v=vs.85).aspx Are you running in a seperate process? Are you familiar with multiple processes? Are you familiar with Interprocess communication? (It's really really fun!) A Windows process can only be tied to one console at a time. So... create a new process. From that process, call FreeConsole. The console … | |
Re: The specification is hosted by libPNG here: http://www.libpng.org/pub/png/spec/1.2/PNG-Contents.html Read the specification and figure out how to write a decoder. If you've never worked with compression algorithms before like LZW and LZMA, it's probably a good idea to start now. **Actually, actually...** forget all that. Start with a **GIF** decoder. Learn … | |
Re: I'm going to go out on a limb and say the OP is asking for help in adding the ability to save data to and recall data from a file. Also, it seems the OP copy and pasted the code 7 times. To the OP's credit, the code was posted … | |
Re: Dead thread is dead. Leave dead thread dead. On the subject of how to go about doing this there's a few different ways: A. Use pipes. B. Use sockets. C. Use environment variables. D. Use shared memory. Also, the OP didn't realize the word would be passed as a parameter … | |
Re: Solved question is solved. But I'm going to throw this in here anyway. #include <cstdlib> #include <iostream> using namespace std; class A{ private: int i; int j; public: A(){ cout<<"Constructor being called!"<<endl; } ~A(){ cout<<"Destructor being called!"<<endl; } int getI(){return i;} void setI(int newI){i=newI;} int getJ(){return j;} void setJ(int newJ){j=newJ;} … | |
Re: SFML has multiple interfaces including one that is C-only (CSFML). http://www.sfml-dev.org/ | |
Re: @Samyx: Try using a dictionary/look-up table approach. Create a table where you plug in the first two spots (0 and 1). Then have your program plug in the data if it isn't already assigned. You might want to fill the table with -1's at first, then assign the first two … | |
Re: Some other guy had the same problem: http://www.imagemagick.org/discourse-server/viewtopic.php?f=6&t=13970 | |
Re: Whenever I start a new programming languange, I always like to start with the same basic program: A podcast ripper. A podcast ripper is a very simple program, but it gives you insights into different aspects of the programming language, the API, and the platform. 1. You download a podcast … | |
Re: Here're some others: First, get a copy of Oracle VirtualBox to run the new OS inside of. https://www.virtualbox.org MikeOS is a good place to get started: http://mikeos.berlios.de/ A related video is here: (Pay attention at **1:57** when he says this takes **effort**) http://www.youtube.com/watch?v=6MJUGVFAXKg These are a series of articles: http://linuxgazette.net/issue77/krishnakumar.html … | |
Re: Here's a hint: Line 114:`bool IsInt32(string s) {` Should look like: `bool Convert::IsInt32(string s) {` This is not the only change you will have to make. Later on, I suggest you change the *methods* in your **Convert** *class* into *static*'s so you can call them directly from the *class* instead … | |
> tl;dr: MegaMan's storyline sucks. I want advice in writing it as realistically as possible. I want to dip my toes into the realm of fiction (due to much prodding by my wife). I decided I wanted to start with a fan-fiction project based on the popular game MegaMan (also … | |
The rules of this game is simple: 1. Someone posts a word. 2. You make a (de)motivational picture out of it. 3. You post the picture and a new word for the next poster. 4. The base image can belong to anyone, but the completed captioned product must be yours. … | |
Re: First, learn to use Allegro. Start here: http://wiki.allegro.cc/index.php?title=Allegro_5_Tutorial Start with this one: http://wiki.allegro.cc/index.php?title=Allegro\_5\_Tutorial#Installing\_Tutorials Get your Allegro libraries setup in your compiler. Then get them ready to link into your project. (Many times, you will need to tell it to link in both Debug and Release configurations). Now check out the … | |
tl;dr: I think my code sucks. Can you help me? I haven't written a test case for this class yet, but I want to make sure I'm doing it right before I go home tonight. The gist of the class is to provide a reusable ImagePrinter object that can print … | |
Re: @Sokurenko: I'm not the kind of guy who down-votes posts willy-nilly (unless you're being condescending and a complete ass), but your post is... not what the OP is asking for. Pass by value, not reference. Yours is reference. Granted, your code is instructive to new coders and you're not rude, … | |
Re: The h after the number means that's it's in hexadecimal. Hexadecimal numbers run from 0-9A-F. Each digit is multiplied by a power of 16. So 57h is 5 * 16^1 + 7 * 16^0. You can also use the **0x** prefix to denote hexadecimal. So 57h is the same as … | |
I've got a program I'm writing that A. runs as a service B. grabs a screenshot of a specific window every X number of seconds C. prints it to the default printer. A and B are more or less done. C is confusing me. I'm looking for a way to … | |
Re: Are you trying to read XML? I wouldn't use RegEx for it. http://stackoverflow.com/questions/1732348/regex-match-open-tags-except-xhtml-self-contained-tags/1732454#1732454 I use TinyXML2. It's pretty simple once you get the hang of it. http://www.grinninglizard.com/tinyxml2/index.html | |
Re: OK. This is a common problem for beginners. You have a pointer (**`*a`**). This pointer points to nothing. You do a scanf into the pointer. The program has an aneurysm. The stock market collapses! Puppies and kittens around the world suddenly vanish! Heh. So yeah. **`*a`** needs something to point … | |
Re: I had to google that to figure it out. And hey, me too! Do you have a date set? | |
Re: Webkit is the browsing engine used by Safari and Chrome. It's open source and cross platform. @OP: If you really really want WebKit, you could try using the QtWebKit port. | |
Re: indices = malloc (sizeof(short) * data.face_count * 3); for (i = 0; i < data.face_count; i += 3); { indices[3 * i] = data.face_list[i]->vertex_index[0]; indices[3 * i + 1] = data.face_list[i]->vertex_index[1]; indices[3 * i + 2] = data.face_list[i]->vertex_index[2]; } Multiply i by 3. Try it. You'll like it. | |
Re: What OS are you using? It makes a difference. Also, if you're looking to do a git like command, are you familiar with socket programming? Next, if you're connecting to a remote server (the way git does) how is the server going to handle your request and in what language? … | |
Re: Put in checkpoints in your code like `printf("Client: Now entering client function.");` Tell us what happens. | |
Re: Start with a simple program. #include <stdio.h> int main(){ printf("Hello World!"); return 0; } Then expand on it. #include <stdio.h> char name[20]="firdousahmad"; int main(){ printf("Hello World!\n"); //The backslashed n starts a new line. printf("My name is %s.", name); //printf will replace the %s with the "name" variable. return 0; } … | |
Re: The Visual Studio libraries probably aren't going to work for MinGW (what Dev C++ compiles with). MinGW = Minimal GNU for Windows. And Dev C++ is kind of dead anyway. Get a full MinGW installation (GCC & G++) with at least a minimal MSYS that has Make. Then get Eclipse … | |
Re: I remember some code Mike Abrash had written that (I believe) found its way onto x2ftp. IIRC (If I recall correctly), he used K&R with **3**-space indents. I guess when you're Mike frickin' Abrash you can pull quirky stunts like that. **EDIT**: I stand corrected. He used **Allman**. But, yes, … | |
Re: Lines 24 and 26. You've got a **for** loop variable **i** going from 0 to 9. You've got a comparison between `score[i]` and `score[i+1]` When **i** hits 9, that's a comparison between `score[9]` and `score[10]`. Silly question for the day: Does `score[10]` exist? Happy coding. -dean | |
Re: Let's start with the I'm a C guy, but this C++ stuff sounds really neat approach: #include <iostream> #include <string> #include <cmath> //#include <math.h> //Don't need this if you have cmath. #include <algorithm> using namespace std; int main() { int number_of_students, i; string dummy, *student_name; //Declare student_name as a pointer … | |
Re: Have you looked here? http://ask.wireshark.org/questions/3885/truncated-cookies | |
Re: Engine001 is suitable for what you want. First, visualize what you want. You want to create a Role-Playing game. Then start small. Make a game with a single room and a single character. Write some backstory on that character. Why is he or she in the room? What does he … | |
Re: I find that a lot of CS majors don't. As for myself, I do. I had a Romanian professor. Is Romania a good place to study if you're majoring in Computer Science? | |
Re: The best way to learn C/C++ is to just sit down with it for a weekend and play with it. Use it to draw a tree. Figure out the price of dinner for two plus tax. Write a number guessing game. Then when you're feeling ready, write a small program … | |
Re: I would say that's platform and compiler dependant. What are you using? | |
Re: Have a look at WinPCap and the related project WireShark. Good luck and happy coding. | |
Re: OK, your paradigm needs a little work. Three things I see. 1. What you're doing is you're **getch()**-ing every time you loop. **Getch()** is a show-stopper. The program won't continue until it has that key press. This won't work for an action game. You need to preface the getch with … | |
Re: A recursive function calls itself with slightly modified parameters from those it was called with. Here's an example of a recursive function. unsigned long factorial(unsigned long n){ if(n>1) return factorial(n-1); else return 1; } | |
Re: Learn **regular expressions**. [Boost::Regex](www.boost.org/libs/regex/) | |
Re: This question has already been answered the last time you posted this. The BGI error is telling you that your program compiled by Borland Turbo C++ can't find the right file for its graphics library. And yes, we only need to see the article title to know it's Turbo C++. … | |
Re: Ancient Dragon is right, but let me offer a few tips on how to hold the hammer. 1. Make sure Eclipse and the C Development Tools are installed. 2. Make sure you have a C++ compiler that will work with them. On Windows, I recommend MinGW w/MSYS. 3. Make sure … |
The End.