Forum: Software Developers' Lounge Nov 2nd, 2007 |
| Replies: 5 Views: 958 Re: Managed C++ and C++/CLI Queries >But I heard it's now no longer in use.
Managed C++ was the precursor to C++/CLI. It's still in use, but for new code you should be using C++/CLI as it's vastly improved.
>C++/CLI could be counted... |
Forum: C++ Nov 2nd, 2007 |
| Replies: 2 Views: 524 Re: Mmorpg >I wanted to create a MMORPG.
That's waaaaaaay beyond you at the moment. Focus on learning C++ as best you can, but don't expect to be able to write an MMORPG anytime soon. You need a lot of... |
Forum: C++ Nov 2nd, 2007 |
| Replies: 2 Views: 1,592 Re: C++ Hashing functions? >I know the theory behind it but i dont seem to be able to put it into code!
Then you don't really know the theory behind it. ;) Not to be rude or anything, but these are all pretty straightforward... |
Forum: C Nov 2nd, 2007 |
| Replies: 19 Views: 5,645 Re: Copy argv to string in C(newbie question) >you are assuming something about implementation dependent architecture
No, you're assuming that 50 is meaningful in telling you the length of the source string. The two examples are not equivalent... |
Forum: C++ Nov 1st, 2007 |
| Replies: 13 Views: 2,450 Re: Concatenation of strings without string.h >I just wanted to change the first character in the sentence to
>uppercase, what would I change to do that?
Don't call toupper on every character, just on the first one:
void printSentence(char... |
Forum: Geeks' Lounge Nov 1st, 2007 |
| Replies: 16 Views: 1,382 Re: back in the good ol days?? >Do you think life would be better if we had start doing things the it ways years ago.
Life is what you make of it. Of course, you should completely define what you mean by "better". :)
>How long do... |
Forum: C Nov 1st, 2007 |
| Replies: 1 Views: 793 Re: Matrix sorting and factorial >wen i use larger values say 245323465 etc. the sorted matrix returned garbage values.. y s that?
Garbage values usually mean that you either didn't initialize the value in the first place, or you... |
Forum: C Nov 1st, 2007 |
| Replies: 19 Views: 5,645 Re: Copy argv to string in C(newbie question) >i'm probably doing something basically wrong in the fubction maybe.
Are you passing any arguments to your program? If not, argv[1] isn't guaranteed to be there, and if it is, it's pretty much sure... |
Forum: C Oct 31st, 2007 |
| Replies: 7 Views: 3,297 |
Forum: C Oct 31st, 2007 |
| Replies: 7 Views: 3,297 |
Forum: C++ Oct 25th, 2007 |
| Replies: 4 Views: 718 Re: Please Help Dynamic Memory Allocation. >Not any more -- C99 has changed that for C language
While C++ has a certain measure of compatibility with C, it's with C89, not C99. In C++, array sizes must be compile-time constants. |
Forum: C++ Oct 25th, 2007 |
| Replies: 11 Views: 1,441 Re: Best language for writing OMR program? If you understood the problem well enough to actually write this program, you wouldn't need to ask what language is best. I'll go out on a limb and say you're in over your head at present. |
Forum: C++ Oct 25th, 2007 |
| Replies: 4 Views: 718 Re: Please Help Dynamic Memory Allocation. >is dynamic memory allocation really necessaryÉ since you already
>know the size of the array which is being passed by the caller
Really? How do you know? If you're talking about the length... |
Forum: C++ Oct 25th, 2007 |
| Replies: 40 Views: 2,044 Re: c++ scores Oh, don't read it as me bashing your solution, it's the same one I'd use. I was just mentioning that little pitfall because I'd noticed it while brainstorming. :) |
Forum: C++ Oct 25th, 2007 |
| Replies: 12 Views: 1,245 Re: xor linked list >but don't know how to use cast. can you help me?
That's something that any C++ book or reference will tell you how to use. It would be "cast" or "type cast" in the index. |
Forum: C++ Oct 25th, 2007 |
| Replies: 5 Views: 383 Re: Quick Question! >since its not returning anything?
I don't understand. It's clearly returning something because the code that calls the function uses the return value:
kptr = function2( n ) ;
You can't use a... |
Forum: C++ Oct 25th, 2007 |
| Replies: 40 Views: 2,044 Re: c++ scores >Once you have a student answer string you compare each element
>of that string with each element of the correct answer string
But from the sample file it looks like if the last N answers were blank,... |
Forum: C++ Oct 25th, 2007 |
| Replies: 12 Views: 1,245 Re: xor linked list >i found something but it has an error :"xor1001.cpp
>invalid conversion from `void*' to `link*' ".
You're compiling C as C++. C++ doesn't support implicit pointer conversions to and from void*. You... |
Forum: C++ Oct 25th, 2007 |
| Replies: 12 Views: 1,245 Re: xor linked list >Doing a linked list using XOR ... I'm not certain what you mean.
It's a hack to avoid wasting extra space on links. It takes advantage of the butterfly effect using XOR. If you take the XOR of two... |
Forum: C++ Oct 25th, 2007 |
| Replies: 12 Views: 2,245 Re: fibonacci >so changing the array to static solved everything.
No, changing the array to static and actually using the values you've cached solved everything. If you don't to the latter, your code won't be any... |
Forum: C++ Oct 25th, 2007 |
| Replies: 40 Views: 2,044 Re: c++ scores >...Now where do i even begin?
You could use everything you've learned in your previous threads that do something similar.
>how do i store them so that the other lines are compared to it for the... |
Forum: C Oct 25th, 2007 |
| Replies: 3 Views: 1,256 Re: Multiple Scanf's Issue >try using %s in the scanf's
No, don't. At least don't until you know how to safely use %s and change the input variables to arrays. Otherwise you'll invoke undefined behavior and create security... |
Forum: C Oct 25th, 2007 |
| Replies: 1 Views: 330 Re: double and float...... It's better to put the code directly in your post if it's short. The problem is that floating-point values aren't always exact, so you can't reliably test for equality. The usual fix for your problem... |
Forum: C Oct 25th, 2007 |
| Replies: 2 Views: 528 Re: subtract 2 signed bianry numbers If it's urgent, won't it be faster to write it yourself than wait for someone to send you something that may or may not work like you want? Also, if it's urgent, it's probably homework, and using... |
Forum: C++ Oct 25th, 2007 |
| Replies: 12 Views: 2,245 Re: fibonacci >And remember, the C++ standard includes the C standard, more or less.
Standard C++ currently maintains compatibility with C89, not C99. So you can't use VLAs in C++
>Is my program the best it can... |
Forum: C Oct 25th, 2007 |
| Replies: 4 Views: 595 Re: English to piglatin help! I'd start with the fact that functions can't be nested inside of each other in C. You're also calling letter before it's declared. |
Forum: C++ Oct 24th, 2007 |
| Replies: 12 Views: 2,245 Re: fibonacci >What about a purely iterative solution, that does not need the excess
>memory, and is not logically limited in the number of values to display?
That's fine for just printing the sequence. The array... |
Forum: C++ Oct 23rd, 2007 |
| Replies: 2 Views: 336 Re: Help >i am currently getting 3 errors
They're telling you that you can't use an array as the condition for a switch statement. You can only use integral values (or char, because char is an integral type). |
Forum: C Oct 23rd, 2007 |
| Replies: 7 Views: 2,045 Re: scanf discussion Just so we're clear. :)
Sloppy code is sloppy code, regardless of whether it's spawned from negligence or ignorance.
That's a safe bet. ;)
I guess I can't argue with carefully contrived... |
Forum: C Oct 23rd, 2007 |
| Replies: 7 Views: 2,045 Re: scanf discussion I didn't realize you were the one who wrote those articles. :)
%s isn't the only way to read strings, but I'll take your point as talking only about %s without a field width.
So is printf for a... |
Forum: C++ Oct 23rd, 2007 |
| Replies: 4 Views: 2,214 Re: Cast double to const char* >I would like to know once and for all how to convert a double to a const char*
Casting doesn't work. You're not converting the double to a string with a cast, you're telling the compiler to use the... |
Forum: C Oct 23rd, 2007 |
| Replies: 7 Views: 2,045 Re: Integer Value! >I disagree. You have to have all kinds of special code to get scanf() to work properly.
Only if you aren't using scanf for what it was designed in the first place. When you have to write workaround... |
Forum: C++ Oct 22nd, 2007 |
| Replies: 23 Views: 977 Re: help >can u write the code so i know wat i need to change?
If I write it for you then you wouldn't need to change anything anymore. ;) Here's a super huge hint though:
double payRate[size];
double... |
Forum: C++ Oct 22nd, 2007 |
| Replies: 23 Views: 977 Re: help >in order to calculate wages, i have tried following
I noticed that hours and payRate weren't ever initialized in your earlier code. If you don't ever put anything in those arrays, you're going to... |
Forum: C++ Oct 22nd, 2007 |
| Replies: 9 Views: 957 Re: Problem with atan2() abs() Do you really want to be casting away the precision when you call abs? Maybe you should be using fabs instead so that it gives you the absolute value without losing the precision. |
Forum: C++ Oct 22nd, 2007 |
| Replies: 23 Views: 977 Re: help >Is it really necessary to write your application in C or C++?
It's probably an assignment for a C++ course, so yea, I imagine it's really necessary. Why do you ask? |
Forum: C Oct 22nd, 2007 |
| Replies: 3 Views: 397 Re: binary There's no way to print a binary value directly in C. You have to break the value up into bits and basically do it all manually:
#include <stdio.h>
int main ( void )
{
int x;
printf ( "Enter a... |
Forum: C++ Oct 22nd, 2007 |
| Replies: 2 Views: 1,330 Re: calling system clock? You can use the standard time library to do it, sort of:
#include <ctime>
#include <iostream>
void long_running_operation()
{
for ( unsigned i = 1; i != 0; i++ )
;
} |
Forum: C++ Oct 22nd, 2007 |
| Replies: 3 Views: 1,697 |
Forum: C++ Oct 22nd, 2007 |
| Replies: 1 Views: 792 Re: Need Help Solving a Complex Class >This program is suppose to add, subtract, and print the complex numbers.
It'd be 100% easier if you used the standard complex stuff from the <complex> header. Despite the name, it's actually quite... |