Forum: C++ Apr 15th, 2009 |
| Replies: 9 Views: 485 Where would a good place be to learn more about multithreading? I don't think there is much at www.cpluplus.com. Any suggestions on libraries/tutorials? Thanks! |
Forum: C++ Mar 19th, 2009 |
| Replies: 1 Views: 549 Start by looking at the fstream library. It will let you write files to disk. It also allows reading from disk. |
Forum: C++ Feb 18th, 2009 |
| Replies: 7 Views: 1,149 You need to put the return 0; at the end of your main() function. The padBlanks() function will return the string. |
Forum: C++ Feb 18th, 2009 |
| Replies: 5 Views: 366 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... |
Forum: C++ Feb 17th, 2009 |
| Replies: 2 Views: 458 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. |
Forum: C++ Jan 21st, 2009 |
| Replies: 9 Views: 626 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. |
Forum: C++ Jan 12th, 2009 |
| Replies: 4 Views: 356 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. |
Forum: C++ Jan 5th, 2009 |
| Replies: 2 Views: 400 Thanks Comatose! I think this should work beautifully :) |
Forum: C++ Jan 5th, 2009 |
| Replies: 2 Views: 400 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. |
Forum: C++ Dec 12th, 2008 |
| Replies: 1 Views: 475 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? |
Forum: C++ Dec 12th, 2008 |
| Replies: 3 Views: 255 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. |
Forum: C++ Dec 10th, 2008 |
| Replies: 2 Views: 454 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... |
Forum: C++ Dec 10th, 2008 |
| Replies: 9 Views: 770 Why not use numbers (1-13) and convert 1, 11, 12, 13 to Ace, Jack, Queen, King when you output? |
Forum: C++ Dec 10th, 2008 |
| Replies: 12 Views: 601 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... |
Forum: C++ Dec 10th, 2008 |
| Replies: 1 Views: 708 Forgot that I need time between playing the music and ending it haha! |
Forum: C++ Dec 9th, 2008 |
| Replies: 1 Views: 708 I'm learning how to use the SDL libraries but I'm having a small problem playing the sound. The program appears to load the sound but either not play it or play it too low for me to hear. Here's my... |
Forum: C++ Dec 5th, 2008 |
| Replies: 4 Views: 297 |
Forum: C++ Nov 23rd, 2008 |
| Replies: 10 Views: 1,720 I believe what you're looking for would be the ASCII character codes (http://www.asciitable.com/). |
Forum: C++ Nov 19th, 2008 |
| Replies: 2 Views: 472 If you are reading in the source code for a C++ program use the iostream (http://www.cplusplus.com/reference/iostream/iostream/) library. If you're trying to read in a .exe file idk... |
Forum: C++ Nov 12th, 2008 |
| Replies: 5 Views: 814 Ah yes I see! That would explain my confusion. Sorry i missed it! |
Forum: C++ Nov 12th, 2008 |
| Replies: 5 Views: 814 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... |
Forum: C++ Oct 24th, 2008 |
| Replies: 4 Views: 419 Thanks guys I really appreciate it! I've been puzzled for a few hours haha |
Forum: C++ Oct 24th, 2008 |
| Replies: 4 Views: 419 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?
int... |
Forum: C++ Oct 23rd, 2008 |
| Replies: 2 Views: 368 Perhaps its something to do with my OpenArray() definition? |
Forum: C++ Oct 23rd, 2008 |
| Replies: 2 Views: 368 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:
int... |
Forum: C++ Oct 23rd, 2008 |
| Replies: 2 Views: 344 Is there an easy way to open an fstream using a string? My code is as follows:
bool openArray(std::string *arrayFileName, int *width, int *height,int *myArray)
{
std::fstream BoardFile;
... |
Forum: C++ Oct 21st, 2008 |
| Replies: 6 Views: 451 In otherwords there isn't a way to easily make your own character in C++ |
Forum: C++ Oct 21st, 2008 |
| Replies: 3 Views: 360 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. |
Forum: C++ Oct 21st, 2008 |
| Replies: 12 Views: 935 Yep! It may be what you're looking for idk |
Forum: C++ Oct 20th, 2008 |
| Replies: 1 Views: 352 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. |
Forum: C++ Oct 20th, 2008 |
| Replies: 4 Views: 899 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 |
Forum: C++ Oct 20th, 2008 |
| Replies: 12 Views: 935 You might want to check out this (http://www.openwatcom.org/index.php/Main_Page). |
Forum: C++ Oct 18th, 2008 |
| Replies: 2 Views: 759 Oh dang yeah! Haha I knew that too! It's been one of those days... thanks! |
Forum: C++ Oct 18th, 2008 |
| Replies: 2 Views: 759 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... |
Forum: C++ Oct 17th, 2008 |
| Replies: 25 Views: 1,890 I personally would like to read such a book but 6,000 pages is a lot of work for something that may never gain much respect. I like your idea but there are many Master's Theses that never go beyond... |
Forum: C++ Oct 16th, 2008 |
| Replies: 16 Views: 1,179 You need to seed the random number generator to make it generate a true random number. Try
#include <ctime>
....
srand((unsigned)time(0));
As for not having enought money you may want to try... |
Forum: C++ Oct 16th, 2008 |
| Replies: 10 Views: 1,353 Unless you absolutely need to know those 9 digits that are missing... but that rarely ever happens :) |
Forum: C++ Oct 16th, 2008 |
| Replies: 5 Views: 373 My method will return 8 squares. I don't know if I quite understand the output you want from 7*8? Give me an example of what squares you want to get... |
Forum: C++ Oct 15th, 2008 |
| Replies: 10 Views: 1,353 If you want to switch to Java it supports the Big Int class... but there is nothing bigger that I know of in C++. |
Forum: C++ Oct 15th, 2008 |
| Replies: 5 Views: 373 Its confusing but post some code once you try it out. |