202 Posted Topics
Re: I believe your problem is in the while loop exit condition. I think are only exiting the loop if there is a '#' found; otherwise the loop continues and x is incremented. Try adding a condition to check if x has exceeded the length of the string. Perhaps something like … | |
Hello all, I have created an RSS object and I would now like to parse out the descriptions of the children. My knowledge of RSS is extremely limited so pardon me if I am incorrect in explaining what I need. For example, I am connecting to [url]http://rss.cnn.com/rss/cnn_topstories.rss[/url] and I would … | |
Re: Your explanation is very thorough. If you want to read more about the concepts you could try [url]http://en.wikipedia.org/wiki/Object-oriented_programming[/url]. | |
Hello, I was just wondering if the hlt instruction would produce a blinking cursor at the command line until enter is pressed or if its use is not noticeable to the user. Google wasn't too helpful for the specifics of the instruction. Thanks! | |
Re: Your 4% interest should probably use a variance of the I = Prt equation where I is interest, P is principle, r is rate, and t is time. solving that for rate when you know that I will by .04P should give you a more accurate rate per month. Make … | |
Hello, I am writing a method which must open a file, read its contents, close the file, open it later, write to the file, and close it again. The method is failing at the first step and throwing an IOException when trying to execute: [CODE]FileInput Stream fileHandler = new FileInputStream("myfile.fil");[/CODE] … | |
Hello, I am having problems using an ObjectInputStream to read from a file. My program uses a File to check whether or not a specific file exists. If it exists my program will attempt to create a FileInputStream for the file and associate an ObjectInputStream with it. It should first … | |
Hello, I am trying to do something very simple but my dial up connection is making it hard to research so I'd like some help! I'm trying to store instances of classes I created in a file. Something along these lines: [CODE] class apple { int flavor; String color; apple(int … | |
Re: Where would a good place be to learn more about multithreading? I don't think there is much at [url]www.cpluplus.com[/url]. Any suggestions on libraries/tutorials? Thanks! | |
Hello, I'm pretty new to PHP and MySQL. I was wondering what the most efficient way to access a large database would be. All the tutorials I've seen show something along the lines of: [icode]$database = mysql_query("SELECT * FROM table");[/icode] But it seems to me that if 'table' was a … | |
Hello, I was wondering if there's a way to use the meta tag to go back. I know you can refresh to a new page but I would like to have the user go back instead. Is this possible? Thanks! | |
Hello, I am very new to PHP and have been working with it now for about a month. My site uses a script to process a POST and generates a new page. The page it generates is saved with the same name as a blank html file on the server. … | |
Re: Start by looking at the fstream library. It will let you write files to disk. It also allows reading from disk. | |
Hello, I am just starting to work with CSS and wondered if there was a good way to make boxes. I found this [URL="http://modxcms.com/simple-rounded-corner-css-boxes.html"]tutorial[/URL] but there are also a number of other ways I have found through Google. What method is the most standard/best? Thanks! | |
Hello, I am new to php and enjoy the fact that it is very similar to languages that I'm much stronger with (mainly C++ and Java). While working through the w3 school's tutorials I noticed a foreach() loop. What loop in C++/Java would this be similar to? It seems like … | |
Re: You need to put the return 0; at the end of your main() function. The padBlanks() function will return the string. | |
Re: Since you assign the value in "a" to "b" you effectively lose the address of the char [] pointed to by "b." You can delete the value pointed to by "b," which will be the same char [] pointed to by "a," but you cannot access the other char [] … | |
Re: Idk for sure I didn't try this but there is a function button1_click(). Perhaps that is where the action for the click should go. Sorry but I don't have a compiler right now to check that with. | |
Hello, I am working on a project that requires a set of points to be sorted by their angles in relation to the x-axis. The angles, which are in radians, store their angle as a double value. My insertion sort algorithm is failing to properly sort the points based on … | |
Hello! I'm just learning JavaScript and I was wondering if clients can view external JavaScript files? I would like to (potentially) use JavaScript to validate passwords to log into my site. Would this work/ is there a better way? | |
Re: If you compile it and it won't run maybe try adding system("PAUSE"); at the end of your code (right before return 0;). This will only work on Windows and isn't portable. | |
I'm having a pretty weird logic error. It seems that this code is always ending my arrays with 3. It should (being a recursive function) iterate through 0, 1, 2, 3. My test array is of length 4 but I am completely missing the reason. Can anyone else see the … | |
I'm a computer science major with a background in C++, not Java. My professor told the class that the Scanner class has a nextInt(), nextDouble(), nextFloat(), etc for every primative type. But whenever I try to use nextChar(), the compiler gives me an "undefined symbol" error. That means that there … | |
Re: You should be able to download the graphics.h library or perhaps copy it from your school's compiler and install it in your home machine. | |
I tried Googling this to no avail: how can I request the used space/ total size of the hard drive? In this case it is safe to assume that the machine will be running Windows. | |
I always wondered if it is possible in Windows to read in general file information (size, created date, modified date, etc) and then modify that data? If it's possible, how can it be done? | |
Re: No he means try system("path\to\file\updater.exe"); This would work if your update program is packaged separately from your actual executable and if you're planning to only distribute on Windows. | |
I was trying to find ways to improve the loading time of an application that I'm working on. It uses SDL to handle graphics and sound which brought up a question: which takes longer to load? If I want to load either graphics or sound into memory during the application … | |
Re: I just quickly glanced at your code so please forgive me if this is wrong but don't you initialize the game[] with the values {1,2,3,4,5,6,7,8,9} but then to tell if there is a move there you compare the value at an index with 0? If none of the values equal … | |
Re: Why not use numbers (1-13) and convert 1, 11, 12, 13 to Ace, Jack, Queen, King when you output? | |
Re: If you are reading in the source code for a C++ program use the [URL="http://www.cplusplus.com/reference/iostream/iostream/"]iostream[/URL] library. If you're trying to read in a .exe file idk... | |
I'm working on a project for school where we have to read from a voters database which is set up in the following manner: voternumber:voternama:havevoted Ex: 1253:Bill Simmons:false 3244:Steve Jobs:true I made this algorithm to search for a voter by ID number but for some reason it keeps coming up … | |
Re: What kind of factorial is this? An input of 3 will result in an output of 6... it should be 3 * 1. If you enter 4 you will get something like 24. Factorials break numbers down like this: 12 factorial = 2 * 2 * 3. To implement a … | |
I am having problems reading in from a file in my project. I have a text file from which I need to read in data for creating some objects. I do not know how much data is in the file but I know the format is 6 lines of string, … | |
Is there an easy way to open an fstream using a string? My code is as follows: [CODE]bool openArray(std::string *arrayFileName, int *width, int *height,int *myArray) { std::fstream BoardFile; BoardFile.open(*arrayFileName);[/CODE] I obviously cannot use this method since *arrayFileName is not char* but is there another way to do it? | |
This code is giving me the error "expected primary-expression before ']' token." After googling and looking around Daniweb I still cannot find what this means. Can anyone enlighten me? [CODE]int board[*width][*height]; if(OpenBoard(boardName, width, height, board[][*height])) { } //... //function definition... bool OpenBoard(std::string *boardFileName, int *width, int *height, int board[][100])[/CODE] | |
Hello, I am trying to pass a multidimensional array to a function but I keep getting a "expected primary-expression before ']' token" error. I'm using Dev-Cpp and here's my code: [CODE]int array[*width][*height]; if(OpenArray(arrayName, width, height, array[][*height]))[/CODE] I suppose it could be because there is nothing actually stored in the array? … | |
Re: Hint: you could start by counting pennies and then count 5's with pennies (for nickels) and then 10's with pennies, then 15's etc. There is a pattern to how you can make change in otherwords haha | |
Re: Try posting an attempt. You may want to store the input in an array and then sum the elements of the array with a loop. counting the numbers will be the next step. Post the sumation code first. | |
Re: In otherwords there isn't a way to easily make your own character in C++ | |
Re: You might want to check out [URL="http://www.openwatcom.org/index.php/Main_Page"]this[/URL]. | |
Re: For the beep I guess you could use an escape character. cout<<"\a"; will give you a beep... sorry I'm not into audio at all. | |
I am writing a program using strings to pass messages into SDL functions. For some reason the compiler will not let me create any string objects though. I get a 'string' undeclared error when I try to compile this code: [CODE]#include "SDL/SDL.h" #include "SDL/SDL_ttf.h" #include <string> int errorMessage(int errorNumber) { … | |
Re: You need to seed the random number generator to make it generate a true random number. Try [CODE]#include <ctime> .... srand((unsigned)time(0));[/CODE] As for not having enought money you may want to try putting "break" statements at the end of your switch cases... but I forget | |
Re: If you want to switch to Java it supports the Big Int class... but there is nothing bigger that I know of in C++. | |
Re: Find a point that is as far in as the length of the height (assuming height < width). Then you have a square and a new rectangle. Repeat the procedure using the shortest side as the side of the new square you want to cut. Do this until S1 == … | |
I am trying to build a project to learn the SDL libraries but Im getting these errors: [Linker error] undefined reference to `SDL_RWFromFile' [Linker error] undefined reference to `SDL_LoadBMP_RW' [Linker error] undefined reference to `SDL_DisplayFormat' ... I am including "SDL\SDL.h" but according to the documentation it should work. Any ideas? | |
Re: position and positiondata should be the same? Also the compiler can't find the gsl directory. You're also passing doubles into the abs() function when it wants an int. Try #include "gsl\gsl_rng.h" | |
I was wondering if there is an easy library that allows reading in a .bmp, mask it, then display it. I believe I could read it in with [URL="http://www.adp-gmbh.ch/win/programming/graphic/bitmap.html"]this[/URL] but I cannot do anything else with it. Your help is appreciated! Any suggestions? |
The End.