Forum: C++ Sep 18th, 2009 |
| Replies: 4 Views: 335 OK, so start by calculating the input ranges, then you can create scale factors to map the input range to the output range. |
Forum: C++ Sep 18th, 2009 |
| Replies: 4 Views: 335 Do you want to?
- clip extreme values, say if ( x > 25 ) x = 25 ?
- scale the graph (max=100), so px = x * 25 / max |
Forum: C++ Sep 18th, 2009 |
| Replies: 5 Views: 294 Short answer - don't mix cin and getline.
They don't play well together.
Plenty of past posts and answers for this problem, look around. |
Forum: C++ Sep 17th, 2009 |
| Replies: 5 Views: 309 Pure dumb luck is all.
Your cout statement basically filled that part of the stack with a value which was harmless enough (maybe even the right answer).
Taking out the cout statement, that part... |
Forum: C++ Sep 17th, 2009 |
| Replies: 5 Views: 309 smallest = PRIORITY[nc[0].row][nc[0].col];
for ( int i = 1; i < cnt; i++ )
If count is 1, bestindex is garbage. |
Forum: C++ Sep 17th, 2009 |
| Replies: 1 Views: 354 Ignore this, reposted here with tags
http://www.daniweb.com/forums/thread223821.html |
Forum: C++ Sep 17th, 2009 |
| Replies: 5 Views: 309 There's a memory overwrite bug in your code somewhere (most likely anyway).
Without seeing the whole code, we're not going to figure anything out staring at those 3 lines. |
Forum: C++ Sep 17th, 2009 |
| Replies: 1 Views: 466 http://cboard.cprogramming.com/cplusplus-programming/119676-need-help-compiling-vcplusplus-6-project-dev-cplusplus-4-9-9-2-a.html
and
http://www.daniweb.com/forums/thread223732.html |
Forum: C++ Sep 17th, 2009 |
| Replies: 2 Views: 319 Tutorial series.
http://www.adrianxw.dk/SoftwareSite/Consoles/Consoles1.html |
Forum: C++ Sep 17th, 2009 |
| Replies: 5 Views: 223 http://www.codeblocks.org/downloads |
Forum: C++ Sep 16th, 2009 |
| Replies: 4 Views: 247 Read the manual - it's good practice for the future. |
Forum: C++ Sep 16th, 2009 |
| Replies: 4 Views: 247 Try
volatile int variable;
Even then, you should really use proper synchronisation.
If the compiler sees
int variable = 0;
while (variable == 0) |
Forum: C++ Sep 16th, 2009 |
| Replies: 6 Views: 281 a) Your "cd" command only lasts as long as the sub-process does (and it only affects the sub-process). If you really want to change the directory in this process, you need to use the chdir() API... |
Forum: C++ Sep 16th, 2009 |
| Replies: 2 Views: 177 http://www.daniweb.com/forums/thread223471.html
Patience, don't spam the board in a panic. |
Forum: C++ Sep 16th, 2009 |
| Replies: 8 Views: 416 Microsoft have their own typically bastardised version
http://msdn.microsoft.com/en-us/library/edze9h7e%28VS.71%29.aspx |
Forum: C++ Sep 16th, 2009 |
| Replies: 4 Views: 353 pow (23, 2)
You're passing two integers.
> 'pow(int, int)' is ambiguous
two integers is confusing....
> double std::pow(double, int)
A variety of combinations involving floating point types... |
Forum: C++ Sep 16th, 2009 |
| Replies: 2 Views: 198 File permissions are platform specific, so you only get access to them using platform specific APIs. |
Forum: C++ Sep 16th, 2009 |
| Replies: 4 Views: 353 Taking a stab at guessing line 98
VoltageGain = double pow ((275 / sqrt (pow (23, 2) + 0.5 * pow (f, 2))), n);
What does double do here? |
Forum: C++ Sep 16th, 2009 |
| Replies: 10 Views: 407 Paste your CODE, not some fuzzy bitmap image.
How the hell are we supposed to quote text from that?
Oh, and the for loop in your ctor is broke. |
Forum: C++ Sep 16th, 2009 |
| Replies: 8 Views: 416 pipes are a POSIX API (and not a language issue at all).
If you've got an appropriate declaration, then you can call them from whatever language you like (perl and python can access pipes as well). |
Forum: C++ Sep 16th, 2009 |
| Replies: 8 Views: 474 > actually i wonder how can i make header file with private and public data?
Yes, they're called classes.
Which is pretty much the root concept of C++ programming.
Time to read the book again. |
Forum: C++ Sep 16th, 2009 |
| Replies: 6 Views: 713 Mmm, hidden process, visible .exe - I wonder what's going on here.... |
Forum: C++ Sep 16th, 2009 |
| Replies: 3 Views: 331 Look at some other forums as well
http://cboard.cprogramming.com/cplusplus-programming/119631-pythagorean-numbers.html
oh wait, you're already there, and making progress.
Why are you here as... |
Forum: C++ Sep 15th, 2009 |
| Replies: 5 Views: 222 http://www.cplusplus.com/reference/iostream/ifstream/
Add some debug code, check the good, bad, eof bits.
Does it work for small files?
Which OS/Compiler are you using?
Are all the lines in... |
Forum: C++ Sep 15th, 2009 |
| Replies: 10 Views: 407 Look at all the pretty colours in your post.
Blue means it's a string - is it really meant to be a string?
Consider looking for the mis-placed " |
Forum: C++ Sep 15th, 2009 |
| Replies: 5 Views: 222 Does
while (getline(sup,line)) temp << line << endl;
succeed in just copying the file?
If it does, then removing the first line is simply
getline(sup,line); // burn line 1
while... |
Forum: C++ Sep 14th, 2009 |
| Replies: 7 Views: 483 So do it in stages, say the spaces up to and including the first hash.
You don't have to write the whole thing just to make progress. |
Forum: C++ Sep 14th, 2009 |
| Replies: 12 Views: 1,209 Shouldn't the OP be looking for a C++ solution, rather than messing with archaic C-style functions and char arrays? |
Forum: C++ Sep 14th, 2009 |
| Replies: 3 Views: 212 You're not passing references to them.
So inside the functions, changes are made on a local copy, which is lost when the function returns. |
Forum: C++ Sep 14th, 2009 |
| Replies: 1 Views: 252 Well gmtime() does most of the donkey work for you. |
Forum: C++ Sep 14th, 2009 |
| Replies: 4 Views: 181 > Here is the error... in german :x
Except that seems to suggest the problem is in a function called calc3() and not one called toDouble().
Did you fix it in all the places?
Posting new error... |
Forum: C++ Sep 14th, 2009 |
| Replies: 4 Views: 200 They're class member functions, which means they need an object to be applied to.
Eg.
mat1.Add(mat1, mat2);
Of course, you might regard one of your parameters as now being redundant.
... |
Forum: C++ Sep 14th, 2009 |
| Replies: 8 Views: 1,194 > And i cannot be persuaded to move to a different language to accomplish my goal.
Why not?
Being good at s/w is being able to recognise the best tool for the job.
There's probably a dozen RFCs... |
Forum: C++ Sep 14th, 2009 |
| Replies: 1 Views: 143 Wait, you want us to wade through a 700+ line haystack (which isn't even complete) looking for a needle which might not even be present in the subset you've posted?
Try using the debugger again.
... |
Forum: C++ Sep 13th, 2009 |
| Replies: 7 Views: 483 int nrP = 6;
for ( i = 1 ; i < nrP ; i++ ) {
cout << i << " " << (2 * nrP - 2 * i - 1) << endl;
}
Notice anything about the sequence of numbers? |
Forum: C++ Sep 13th, 2009 |
| Replies: 2 Views: 632 Are we sitting comfortably, then I shall begin.
http://wiki.osdev.org/Main_Page
http://www.nondot.org/sabre/os/articles |
Forum: C++ Sep 13th, 2009 |
| Replies: 8 Views: 517 Seems to me like a case of not using the right tools for the job.
Doing this as a browser plugin would be a snap (by comparison).
Starting where you are, you're basically saying "I need to use... |
Forum: C++ Sep 12th, 2009 |
| Replies: 5 Views: 395 So use the debugger and put a breakpoint at the start of where you suspect the problem starts, and then wait for the first of the "first chance exceptions" to happen.
Then home in on the problem. |
Forum: C++ Sep 12th, 2009 |
| Replies: 2 Views: 127 Is that
char *_filename;
or
char _filename[1000];
Or why are you messing with char arrays when there is a perfectly usable std::string which would have seen you finished hours ago. |
Forum: C++ Sep 12th, 2009 |
| Replies: 5 Views: 395 Lessons in cause and effect.
Memory is allocated from one (or more) larger pools of memory.
int main ( ) {
int *p = new int[10];
for ( int i = 0 ; i <= 10 ; i++ ) p[i] = 0; //... |