Forum: C Sep 18th, 2009 |
| Replies: 2 Views: 305 Standard C doesn't allow you to declare variables in the middle of statement blocks. |
Forum: C++ Sep 18th, 2009 |
| Replies: 4 Views: 328 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: 328 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: 287 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 18th, 2009 |
| Replies: 3 Views: 598 http://www.daniweb.com/forums/thread223648.html
The amount of effort it took just to reverse a string makes this near impossible for you.
You need some more intermediate steps if you actually... |
Forum: C Sep 17th, 2009 |
| Replies: 20 Views: 766 Post your code!
Did you initialise i ? |
Forum: C Sep 17th, 2009 |
| Replies: 20 Views: 766 result[numchars++] = basechars[r];
When you're done, print from numchars-1 back down to 0 (one char at a time). |
Forum: Computer Science Sep 17th, 2009 |
| Replies: 3 Views: 353 http://www.daniweb.com/forums/announcement14-2.html
http://www.catb.org/~esr/faqs/smart-questions.html#urgent |
Forum: C++ Sep 17th, 2009 |
| Replies: 5 Views: 299 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: 2 Views: 383 > typedef struct queue_type *Queue;
This should come AFTER your actual struct declaration. |
Forum: C Sep 17th, 2009 |
| Replies: 20 Views: 766 > basechars[r]
You're printing them, not storing them! |
Forum: C++ Sep 17th, 2009 |
| Replies: 5 Views: 299 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: 5 Views: 332 Well writing it on Linux using g++ would be a real test of your skill at writing portable software that will compile on ANY compiler. |
Forum: C Sep 17th, 2009 |
| Replies: 20 Views: 766 Store each char in another array, then print it out backwards? |
Forum: C++ Sep 17th, 2009 |
| Replies: 1 Views: 341 Ignore this, reposted here with tags
http://www.daniweb.com/forums/thread223821.html |
Forum: Java Sep 17th, 2009 |
| Replies: 4 Views: 294 > the most complicated program ive made is something that converts hexa to octa and all.
You've mastered hopscotch on the paving slabs, and now you want to try and leap across the Grand Canyon.
... |
Forum: C++ Sep 17th, 2009 |
| Replies: 5 Views: 299 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: 20 Views: 766 Well it's good for bases < 10
char basechars[] = "0123456789";
and
printf("%c", basechars[r] ); |
Forum: Shell Scripting Sep 17th, 2009 |
| Replies: 4 Views: 477 > Now I want a shell script to automate this process.
Give us an idea of the kinds of repetitive commands you type in (and as skanke points out - which machine you type them on).
Perhaps then,... |
Forum: C Sep 17th, 2009 |
| Replies: 8 Views: 249 More cross-forum spamming
http://cboard.cprogramming.com/c-programming/119681-help-c-code.html
Ever feel like you're just wasting effort reading and answering the SAME question over and over... |
Forum: C Sep 17th, 2009 |
| Replies: 5 Views: 332 > I use only linux and I am unable find the compiler.
And what are you going to do with the executable when you've compiled your code? |
Forum: Troubleshooting Dead Machines Sep 17th, 2009 |
| Replies: 2 Views: 385 http://en.wikipedia.org/wiki/Non-maskable_interrupt
> Devices (Bus:Dev:Func) with SERR set at the time of the NMI:01:1C:01"
Depending on your BIOS (it may also be in windows device manager... |
Forum: C++ Sep 17th, 2009 |
| Replies: 1 Views: 440 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: 306 Tutorial series.
http://www.adrianxw.dk/SoftwareSite/Consoles/Consoles1.html |
Forum: C Sep 17th, 2009 |
| Replies: 5 Views: 296 char *words[n];
words[0] = wordlist[0];
And so on. |
Forum: C++ Sep 17th, 2009 |
| Replies: 5 Views: 220 http://www.codeblocks.org/downloads |
Forum: C Sep 17th, 2009 |
| Replies: 20 Views: 766 > That is how I get the binary.
That's how you do it for every other base as well. |
Forum: C Sep 17th, 2009 |
| Replies: 2 Views: 461 16 replies over here -> http://cboard.cprogramming.com/c-programming/119668-circular-buffer.html
In other news -> http://www.catb.org/~esr/faqs/smart-questions.html#forum
And finally, the... |
Forum: C++ Sep 16th, 2009 |
| Replies: 4 Views: 243 Read the manual - it's good practice for the future. |
Forum: C++ Sep 16th, 2009 |
| Replies: 4 Views: 243 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: 276 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: 173 http://www.daniweb.com/forums/thread223471.html
Patience, don't spam the board in a panic. |
Forum: Perl Sep 16th, 2009 |
| Replies: 3 Views: 528 Generate 1 digit, in a loop which runs 8 times. |
Forum: C++ Sep 16th, 2009 |
| Replies: 8 Views: 409 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: 5 Views: 296 Sure, but that would take up more memory.
You would need to store an array of char* somewhere. |
Forum: C Sep 16th, 2009 |
| Replies: 4 Views: 243 http://cboard.cprogramming.com/c-programming/119649-malloc-why.html |
Forum: C++ Sep 16th, 2009 |
| Replies: 4 Views: 343 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: 5 Views: 296 A pointer to a 2D array is not a **
http://www.daniweb.com/forums/post859293.html#post859293
Use the typedef approach if you want to keep your sanity ;) |
Forum: C++ Sep 16th, 2009 |
| Replies: 2 Views: 193 File permissions are platform specific, so you only get access to them using platform specific APIs. |
Forum: C++ Sep 16th, 2009 |
| Replies: 4 Views: 343 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? |