Forum: C++ Mar 21st, 2008 |
| Replies: 30 Views: 1,532 Either you didn't know that you should use braces, or you forgot.
for (int i=0;i<rollsize;i++)
{
switch (rolls[i])
{ // Forgot this
case 3:allresults[0] = allresults [0]+1;... |
Forum: C++ Feb 18th, 2008 |
| Replies: 2 Views: 1,807 time.h (http://www.cplusplus.com/reference/clibrary/ctime/) |
Forum: C++ Feb 8th, 2008 |
| Replies: 5 Views: 833 make the following changes to the set function.
void LList::set(int c, int val)
{
int i = size-1;
current = head;
while ( current != NULL )
{
if(i==c) |
Forum: C++ Jan 26th, 2008 |
| Replies: 20 Views: 2,460 No he has not missed the point. You have. Arguments can be used to pass things both in and out. Passing by reference can be used to get things out. It is also memory efficient because another copy of... |
Forum: C++ Jan 17th, 2008 |
| Replies: 21 Views: 3,928 Didn't your professor or anybody else at least tell you about this awfully fun site called http://www.google.com/ where you can type A-Star Algorithm... |
Forum: C++ Jan 5th, 2008 |
| Replies: 4 Views: 1,415 Documentation is not written by the developers for fun you know. Unless you are using fairly well known, well established APIs like the Windows API, the chances that someone who has used the library... |
Forum: C++ Dec 24th, 2007 |
| Replies: 1 Views: 584 If you have no previous knowledge of C++ the best thing will be to start by learning C++ (http://www.cprogramming.com/tutorial/lesson1.html). The link has information about editors and compilers... |
Forum: C++ Dec 24th, 2007 |
| Replies: 3 Views: 857 Well, you could do that programmatically, but you will need administrative priviledges for that. Wouldn't it be easier to let the user unblock the application by his own accord? After all it is his... |
Forum: C++ Dec 17th, 2007 |
| Replies: 11 Views: 3,543 Something like this will be easy. There are more compilicated methods if you want to break Japanese or Chinese words. Also you can use a callback function to count the words on the fly, but I think... |
Forum: C++ Dec 14th, 2007 |
| Replies: 1 Views: 6,236 C++ does not give you a method out of the box for multithreading like Java does.
To use multithreading, you will have to use the thread libraries offered by the operating system. For win32 you will... |
Forum: C++ Sep 20th, 2007 |
| Replies: 3 Views: 2,354 The usual reason is that you are not including the library that provides the implementation of pthread_create(). Check the documentation for pthread_create()and find out the required library. Then... |
Forum: C++ Jul 24th, 2007 |
| Replies: 1 Views: 3,762 Get the return value of GetPixel and RGB functions to seperate variables. See if the values are infact what you expect, rather than just comparing them.
Also read the remarks section of the... |
Forum: C++ May 30th, 2007 |
| Replies: 4 Views: 856 First debug it part by part and localize the error. Without knowing what is expected for the output, we are not in the position to debug all that long code. So you will be better off doing it... |
Forum: C++ May 20th, 2007 |
| Replies: 4 Views: 4,097 For god's sake people. Let's stop joking and wait till the OP posts his code? This is not the geek's lounge for crying out loud. |
Forum: C++ Dec 20th, 2006 |
| Replies: 5 Views: 2,649 Try the built in _CRTDebug (http://msdn2.microsoft.com/en-us/library/1666sb98%28VS.80%29.aspx)Libraries of Visual C++. |
Forum: C++ Nov 7th, 2006 |
| Replies: 4 Views: 878 I beleive you wanted to update the static variable shipPos1 instead of the variable shipPos which I don't see defined anywhere. |
Forum: C++ Nov 1st, 2006 |
| Replies: 2 Views: 1,072 See if you can see anything useful here (http://www.cppreference.com/cppvector/index.html). |
Forum: C++ Oct 31st, 2006 |
| Replies: 4 Views: 2,248 Too long to make all the corrections. Make corrections for number 1 and number 19. You can understand as I have commented the changes. Do the others yourself and post if you have other problems.
... |
Forum: C++ Oct 31st, 2006 |
| Replies: 9 Views: 2,867 This is correct. So no idea. Maybe you have not saved the correction. Or you are linking a different file. Anyway it is a problem with the linker, and not the source code. The sourcecode is correct.... |
Forum: C++ Oct 24th, 2006 |
| Replies: 8 Views: 15,878 Right. This is what you should do.
1. Open the file ( You have already done that)
2. Read the opened file line by line into a string (lets call it line). You can use getline ... |
Forum: C++ Oct 16th, 2006 |
| Replies: 2 Views: 1,174 Sorry. We don't do homework :) |
Forum: C++ Oct 4th, 2006 |
| Replies: 6 Views: 3,073 struct SongInfo
{
int track_no,
track_pos,
track_len_min,
track_len_sec,
runtime;
SongInfo *next; |
Forum: C++ Sep 25th, 2006 |
| Replies: 25 Views: 5,995 Not sure whether it would work for TurboC and the old command.com shell, but you could try creating the command using double quotes to handle filenames with spaces. Don't know what will happen for... |
Forum: C++ Sep 18th, 2006 |
| Replies: 3 Views: 2,274 Yes. That is all you need to start coding.
But If you are a beginner, first try the Visual studio express edition (http://msdn.microsoft.com/vstudio/express/visualc/), which can be downloaded for... |
Forum: C++ Sep 18th, 2006 |
| Replies: 8 Views: 3,048 Here (http://www.catch22.net/tuts/editor01.asp). |
Forum: C++ Sep 8th, 2006 |
| Replies: 11 Views: 2,038 The answer to this is in the web link I gave you in my reply. Something about the static variable being initialized globally. See if you can find it.
class A
{
public:
int a;
};
... |
Forum: C++ Sep 6th, 2006 |
| Replies: 5 Views: 17,845 If you are sure that the string is in double conversible format like 1.2e-2, grunt's method is the eaisest. But if you want to check the input string if it can be converted as double, e.g 123abc will... |
Forum: C++ Sep 4th, 2006 |
| Replies: 11 Views: 2,038 Lets take class A such that
class A
{
int i;
int j;
} A default constructor is a constructor that doesn't take any arguments.
e.g. A::A();
An overloaded constructor is a... |
Forum: C++ Aug 31st, 2006 |
| Replies: 6 Views: 2,097 Just put #include <iostream> after the
#include "stdafx.h" line.
It would be better if you select the "Create Empty Project" option and then start from scratch. That gives you a better feel of... |
Forum: C++ Aug 25th, 2006 |
| Replies: 4 Views: 3,877 You can either use
char filename[MAX_PATH];
GetModuleFileName(NULL, filename, MAX_PATH); or
the command line passed to WinMain
int WINAPI WinMain(HINSTANCE instance, HINSTANCE... |
Forum: C++ Aug 8th, 2006 |
| Replies: 16 Views: 4,962 This code is illegal because a reference has to be initialized not assigned. There are exceptions but in this case it has to be initialized.
The Standard does not specify whether references need... |
Forum: C++ Aug 6th, 2006 |
| Replies: 17 Views: 4,543 I posted a link a bit later in my earlier solution. Check it out and see if the error can be corrected. |
Forum: C++ Aug 2nd, 2006 |
| Replies: 3 Views: 1,110 Please format your code properly.
Increase the Tab settings
put braces even for the places where there is only one statement inside a for loopWhen debugging problems, you don't debug all of the... |
Forum: C++ Jul 26th, 2006 |
| Replies: 4 Views: 14,358 You probably wouldn't need the temporary variable if you use something like this.
iifstream file(filename);
string line;
if (file)
{
string token;
stringstream iss;
... |
Forum: C++ Jul 26th, 2006 |
| Replies: 4 Views: 14,358 try
ifstream file(filename);
if (file)
{
while ( file.getline(line,SIZE) )
{
tmp =static_cast<string>(line);
vector <string> array;
string token; |
Forum: C++ Jun 1st, 2006 |
| Replies: 3 Views: 1,527 Okay I will go with the short story.
You RTF(ine)Manual (http://www.digitalmars.com/ctg/sc.html).
Well any decent compiler should be able to compile multiple source files at once. You should be... |
Forum: C++ Mar 14th, 2006 |
| Replies: 9 Views: 6,725 Well I took a look at your problem. Regarding the bisection-method looks as if you dont have an idea with what you are doing. I will give you a brief algorithm here and try to see if you can... |
Forum: C++ Feb 14th, 2006 |
| Replies: 13 Views: 8,404 Okay. Got it. You are trying to open the same file twice.
Here are the culprits.
case CM_FILE_SAVE:
{
//...
HANDLE hFile;
hFile = CreateFile( WindowText, GENERIC_READ, FILE_SHARE_READ,... |
Forum: C++ Jan 25th, 2006 |
| Replies: 12 Views: 4,213 Narue's method should work. But I could not get it to compile in my machine. It needs Windows XP or higher.
Here is a small piece of code that resizes the window. But the dimensions should be... |
Forum: C++ Dec 1st, 2005 |
| Replies: 1 Views: 5,935 maybe this (http://www.sqlapi.com/) will help. |