Forum: C++ Mar 20th, 2009 |
| Replies: 38 Views: 3,370 Firstly, don't use sysrtem. use the function given to you by AncientDragon.
Secondly for an example, read the page it has a link to one.
Thirdly, that page tells you what parameters are needed,... |
Forum: C++ Mar 20th, 2009 |
| Replies: 1 Views: 360 The size of arrays are resolved at compile time, when qs_pair is 10, thus when you enter more than 10 you will get overflow errors.
You should be using dynamic allocation when dealing with... |
Forum: C++ Mar 20th, 2009 |
| Replies: 17 Views: 1,114 You cannot asign an unknown value to the size of an array at compile time. You need to use dynamic memory.
double *P = new double[N];
...
delete [] P;
For the second bit, you cannot do a... |
Forum: C++ Mar 12th, 2009 |
| Replies: 10 Views: 668 Perhaps his real question is how can he compute the value of that series to a given figure amount using C++? |
Forum: C++ Mar 12th, 2009 |
| Replies: 5 Views: 457 Don't bother using text tags for yout text, thats not what its for. it stands for Latex, a Mathematical Notation Syntax.
Secondly, we don't know what your program is supposed to do and what it is... |
Forum: C++ Mar 12th, 2009 |
| Replies: 7 Views: 469 Unmanaged Win32 Code, is directly interfacing with the win32 API. Managed Win32 is using the MFC. Which is what MVC++ users tend to do. Thus you do not need the catorgarized link that he sent you,... |
Forum: C++ Mar 11th, 2009 |
| Replies: 8 Views: 427 use a string comparison function rather than a pointer to the first letter in the string. Use strcmp().
Chris |
Forum: C++ Mar 11th, 2009 |
| Replies: 5 Views: 1,271 It's really not to hard, if you know some basic file handling techniques you can do it no problem.
It can get a bit more advanced but to start with it's simple enough, and I'm sure if you do some... |
Forum: C++ Mar 11th, 2009 |
| Replies: 7 Views: 469 First of all, i'm going to assume that you are using Visual C++, since after all thats the link you posted. Please make it clear if you are using Manged or Unmanged Win32 for your application, even... |
Forum: C++ Mar 11th, 2009 |
| Replies: 5 Views: 1,271 It's not as easy as it sounds, since there is alot of information in an xls file, ofcourse there are different versions too. http://sc.openoffice.org/excelfileformat.pdf
Normally when you are a... |
Forum: C++ Mar 6th, 2009 |
| Replies: 13 Views: 396 scanf()
Have a quick read over a basic C tutorial |
Forum: C++ Mar 6th, 2009 |
| Replies: 8 Views: 705 It's a combination of the F4 key code combined with the alt modifiers, you need to check both.
But i'd avoid trying to prevent it if I was you.... |
Forum: C++ Mar 6th, 2009 |
| Replies: 5 Views: 287 Please use code tags, .
Firstly, is this C or C++ because it looks like a strange confusion between the two. The only header you should be using in this program is #include <iostream> not with a... |
Forum: C++ Mar 6th, 2009 |
| Replies: 2 Views: 483 :O
You could have at least gave a platform independant solution!cin.get();oreven better yet, run your commandline program from the commandline/termianl xD
Chris |
Forum: C++ Mar 6th, 2009 |
| Replies: 1 Views: 252 You are trying to return a class object when your function says its return type is void...you missed a semi colon, and you are trying to cout<< a class object, so you either need to change what you... |
Forum: C++ Mar 4th, 2009 |
| Replies: 4 Views: 319 You are still not using code tags, I expect your replies from now on will be of little help to you, read what I put carefully as it may be some of the last half decent advice you get before people... |
Forum: C++ Mar 4th, 2009 |
| Replies: 10 Views: 540 Well you need to give us a starting point as to what you have, my suggestion is that you have an image placeholder thingy, and then change the source of it when each button is pressed, ofcourse I... |
Forum: C++ Mar 4th, 2009 |
| Replies: 4 Views: 614 while(displaying):
if 1 min past:
display time
else:
do nothing
loop
Also is this C or C++ code, it looks to me like C, yet you are in a C++ forum. Either way it is buggy.
... |
Forum: C++ Mar 4th, 2009 |
| Replies: 4 Views: 614 Well if you are using time.h which should be ctime in C++, then you can simple calculate when the next time a minute has passed so says its currently 12:31 then you can add 1 to that and check to see... |
Forum: C++ Mar 2nd, 2009 |
| Replies: 3 Views: 2,228 You were correct, in the fist cast it would take O(N+1) time to push/pop, since it would be N for traversal and 1 for the push/pop.
In the second case it would be O(1) since you already have the... |
Forum: C++ Feb 25th, 2009 |
| Replies: 4 Views: 297 when you use cin>> characters are left in the input buffer, then when you call getline() the characters that are left in the input buffer, thus effectively skipping it.
So you should call that... |
Forum: C++ Feb 25th, 2009 |
| Replies: 3 Views: 301 Firstly, please you appropriate thread names, rather than things such as "Help me!" or "Problem!"
Your problem however is the fact that you are calling your constructer as Coord(), not... |
Forum: C++ Feb 25th, 2009 |
| Replies: 2 Views: 471 Damn, forum rules much...did you read?
I'd suggest that you don't post that many lines of code. You are refering to line numbers, yet you didnt show line numbers.... tags would have done the job,... |
Forum: C++ Feb 25th, 2009 |
| Replies: 2 Views: 295 Well you might want to use getline(), but the reason it doesn't work is that the ifstream constructor requires a C-Style string i.e. null terminated character array, not an object of type string.... |
Forum: C++ Feb 13th, 2009 |
| Replies: 6 Views: 846 Hate to tell you this, but they don't exist in C either.
Chris |
Forum: C++ Feb 13th, 2009 |
| Replies: 3 Views: 468 You need to pass two parameters to the function, I guess you could always do something like overload /= ?
Chris |
Forum: C++ Feb 13th, 2009 |
| Replies: 2 Views: 334 Have you written your program in MSVSC++? If so then it's probably .NET code and will require the users has .NET framework installed, and that you have distributed the required DLL files.
Chris |
Forum: C++ Feb 13th, 2009 |
| Replies: 5 Views: 944 The other option would be to close the file stream and then re-open, btw be sure to check that you actually need to read the file stream twice, rather than loading it contence into some data... |
Forum: C++ Feb 13th, 2009 |
| Replies: 3 Views: 942 If you want to raise something to the power of something then you have two choices,
A) include <cmath> and use its pow() function.
B) Write and recursive, or none recursive power function of your... |
Forum: C++ Feb 13th, 2009 |
| Replies: 7 Views: 423 I think you should re-read your previous thread about creating 2D arrays witht he new operator. Look at the following two lines, If I remember correctly, I stated that to create a two dimensional... |
Forum: C++ Feb 13th, 2009 |
| Replies: 6 Views: 633 Well you know you have reached the end of the linked list if the pointer to the next is equal to NULL.
By the way, you can do this with only the original linked listed, so there is no need for... |
Forum: C++ Feb 13th, 2009 |
| Replies: 2 Views: 274 Do you mean how do you compare the value of crop at one node with the value of crop at another given node?
It's as simple as it sounds....
aNode->info->crop == anotherNode->info->cropChris |
Forum: C++ Feb 11th, 2009 |
| Replies: 5 Views: 627 I find it interesting how When one person comments you can be so blunt and rude, yet when others side with him you are no long quite so rude. No doubt because you realised you were in the wrong. |
Forum: C++ Feb 11th, 2009 |
| Replies: 5 Views: 627 http://www.daniweb.com/forums/thread78223.html
http://www.catb.org/~esr/faqs/smart-questions.html
http://www.daniweb.com/forums/announcement8-3.html
Please enjoy the rest of your day sir.
... |
Forum: C++ Feb 10th, 2009 |
| Replies: 4 Views: 1,461 Project -> Build Options -> Linker -> add -> gdi32
Chris |
Forum: C++ Feb 9th, 2009 |
| Replies: 4 Views: 1,461 You need to link "gdi32.dll" into your project :)
Chris |
Forum: C++ Feb 9th, 2009 |
| Replies: 4 Views: 231 Her is an example, #include <ctime>
srand((unsigned)time(NULL));
int a = rand() % 10 +1;this code stores a value between 1and 10 :)
Chris |
Forum: C++ Feb 9th, 2009 |
| Replies: 7 Views: 1,003 Thats what his code does, but that doesn't mean that "1dfjkghdflgh" is an integer, because it isn't. But by your logic it would be.
Chris |
Forum: C++ Feb 9th, 2009 |
| Replies: 3 Views: 1,642 1) Read the rules.
2) Search the forums
3) Show code attempts |