Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Showing results 1 to 37 of 37
Search took 0.01 seconds.
Search: Posts Made By: Tama
Forum: C++ Jan 29th, 2005, 7:37 AM
Replies: 4
Views: 271
Posted By Tama
Try this instead; Vector& Vector::operator=...

Try this instead;

Vector& Vector::operator= (const Vector& v)
{
x = v.x;
y = v.y;
z = v.z;

return *this;
}
Forum: C++ Jan 24th, 2005, 5:34 PM
Replies: 18
Views: 964
Posted By Tama
>C++ looks more cryptic with cin>> and...

>C++ looks more cryptic with cin>> and cout<<
Just wait until you see how cin>> and cout<< are defined. :D
Forum: Coder's Corner Lounge Jan 23rd, 2005, 8:29 PM
Replies: 20
Views: 412
Posted By Tama
I'm a manager for the software development...

I'm a manager for the software development division of a large corporation.
Forum: C++ Jan 23rd, 2005, 8:23 PM
Replies: 18
Views: 964
Posted By Tama
>A lot of older programmers use and prefer C. I...

>A lot of older programmers use and prefer C.
I would hardly consider myself "older", yet I prefer powerful, flexible, and light-weight programming languages. C++ fails the latter.
Forum: C++ Jan 23rd, 2005, 3:58 PM
Replies: 69
Views: 1,982
Posted By Tama
>So they do just about the same thing, except...

>So they do just about the same thing, except that += makes it easier for the programmer on more complex strings...
Both do the same thing, they just do it differently so that the compound assignment...
Forum: C++ Jan 23rd, 2005, 3:38 PM
Replies: 69
Views: 1,982
Posted By Tama
>I also don't get the diference between a = a - 5...

>I also don't get the diference between a = a - 5 and a -= 5, and so on...
a is only evaluated once using the compound operators. With a simple variable like your example, that's not an issue. The...
Forum: C++ Jan 23rd, 2005, 3:29 PM
Replies: 18
Views: 964
Posted By Tama
>i was just trying to figure out why people still...

>i was just trying to figure out why people still use C when C++ can do the same plus more.
Just because you're capable of doing more doesn't mean you have to. More importantly, there's a huge source...
Forum: C++ Jan 23rd, 2005, 3:19 PM
Replies: 3
Views: 245
Posted By Tama
>srand(time(NULL)); Keep in mind that this isn't...

>srand(time(NULL));
Keep in mind that this isn't guaranteed to work. The only thing you are assured to be able to do with a time_t value is compare it with (time_t)-1. Any other use is nonportable.
Forum: Perl Jan 22nd, 2005, 10:35 PM
Replies: 2
Views: 583
Posted By Tama
>I've done some asking around; I'm pretty sure...

>I've done some asking around; I'm pretty sure it's not warez.
Where have you asked? I would say that unless the authors say they're okay, the online versions are suspect.
Forum: C++ Jan 22nd, 2005, 10:32 PM
Replies: 18
Views: 964
Posted By Tama
>How much different is it from C++ It depends on...

>How much different is it from C++
It depends on how you use C++, how you use C, and what features unique to either you stick to. C and C++ can be virtually identical, or completely different.

>but...
Forum: C++ Jan 22nd, 2005, 10:20 PM
Replies: 3
Views: 245
Posted By Tama
#include <cstdlib> #include <iostream> using...

#include <cstdlib>
#include <iostream>

using namespace std;

int main()
{
for (int i = 0; i < 10; i++)
cout<< (static_cast<double>(rand()) / RAND_MAX) * 100 <<'\n';
cout<<endl;
Forum: C++ Jan 21st, 2005, 6:28 PM
Replies: 2
Views: 163
Posted By Tama
>I know the way the header files should be...

>I know the way the header files should be included in vc++( #include<graphics>).
Omitting the .h only applies to standard headers. graphics.h is a Borland extension. On top of that, assuming you're...
Forum: Coder's Corner Lounge Jan 20th, 2005, 8:04 PM
Replies: 22
Views: 894
Posted By Tama
Recursion is best used where it solves the...

Recursion is best used where it solves the problem with considerably less effort and without being terribly inefficient. Anyone who has a strong opinion either way is needlessly restricting himself.
Forum: C++ Jan 19th, 2005, 6:01 PM
Replies: 4
Views: 422
Posted By Tama
>rand() returns an pseudo-random integer between...

>rand() returns an pseudo-random integer between 1 and RAND_MAX.
[0..RAND_MAX), which means that the range of returned values will be 0 to RAND_MAX - 1.

>i mean why do i need 100%range what do i...
Forum: C# Jan 17th, 2005, 5:34 PM
Replies: 61
Views: 2,165
Posted By Tama
>I got an error that said ReadKey() was not in...

>I got an error that said ReadKey() was not in System.
ReadKey is new with C# 2.0. Get the latest version of the .NET framework and C# compiler and things will work nicely. That's why I suggested...
Forum: C++ Jan 17th, 2005, 5:23 PM
Replies: 1
Views: 224
Posted By Tama
Try creating a class for each player along with a...

Try creating a class for each player along with a contained class for generic stats. Don't worry about organization until you know exactly what fields you want to search on. Then you can come up with...
Forum: C++ Jan 17th, 2005, 5:16 PM
Replies: 12
Views: 663
Posted By Tama
What have you tried so far? This is about as...

What have you tried so far? This is about as basic as it gets, and any book on C++ will cover the syntax necessary to do it.
Forum: C# Jan 16th, 2005, 8:01 PM
Replies: 61
Views: 2,165
Posted By Tama
>What do I need to get started writing code in...

>What do I need to get started writing code in c#?
You need a C# compiler and a reference book. Since you're already familiar with C++, the basic syntax shouldn't be a problem. You can download a...
Forum: C++ Jan 16th, 2005, 9:20 AM
Replies: 2
Views: 278
Posted By Tama
That's the startup module. Did you set up the...

That's the startup module. Did you set up the compiler according to the installation instructions? The compiler looks in whatever library directory you specify, and if you don't specify one then it...
Forum: C++ Jan 14th, 2005, 9:33 PM
Replies: 7
Views: 364
Posted By Tama
The only difference between '\n' and endl is that...

The only difference between '\n' and endl is that endl will automatically flush the stream while '\n' will not.

>But using endl instead of "\n" will automatically cause the "\r" to be inserted
'\n'...
Forum: C++ Jan 14th, 2005, 9:27 PM
Replies: 3
Views: 208
Posted By Tama
>void main() int main(). A void return value has...

>void main()
int main(). A void return value has never been correct C or C++.

>int array[i][j]=(int)malloc(sizeof(int));
This will fail to work for quite a few reasons. First, arrays must have a...
Forum: C++ Jan 14th, 2005, 9:13 PM
Replies: 2
Views: 336
Posted By Tama
>am I correct? For the most part. The most...

>am I correct?
For the most part. The most noticeable differences between malloc and new is that malloc will return a null pointer if it fails and new will throw an std::bad_alloc exception (by...
Forum: C++ Jan 14th, 2005, 9:08 PM
Replies: 2
Views: 235
Posted By Tama
>what is the best (least collisions as well as...

>what is the best (least collisions as well as fast) hash algorithm for use with hash tables?
There is none, your hash function is heavily dependent on the data being hashed.
Forum: C++ Jan 2nd, 2005, 9:57 AM
Replies: 12
Views: 414
Posted By Tama
All format modifiers for the scanf family except...

All format modifiers for the scanf family except %c, %[ and %n will skip leading whitespace. So the second call will do what you would expect rather than loop infinitely.
Forum: C++ Jan 1st, 2005, 1:39 PM
Replies: 6
Views: 292
Posted By Tama
>i have msvc 6.0 intro version, and i can't...

>i have msvc 6.0 intro version, and i can't compile anything
Visual C++ 6 was okay if you weren't trying to use standard C++, otherwise it was crap.

>i was using the free one i got online, lol
From...
Forum: C++ Jan 1st, 2005, 1:37 PM
Replies: 12
Views: 414
Posted By Tama
>Does this seem like a good approach to the...

>Does this seem like a good approach to the problem?
Well, it's somewhat of a roundabout solution. Don't you think it would be easier to do this instead?

/* Assuming the largest a word can be is 50...
Forum: C++ Jan 1st, 2005, 9:22 AM
Replies: 6
Views: 292
Posted By Tama
Visual C++ is a part of Visual Studio. And yes,...

Visual C++ is a part of Visual Studio. And yes, you can write straight C++ with it, and yes, it's a good compiler. But Visual C++ 6 is not. If you want a good Microsoft compiler, get the latest and...
Forum: Other Programming Languages Dec 31st, 2004, 12:04 PM
Replies: 3
Views: 211
Posted By Tama
>do you have any suggestions on some programs...

>do you have any suggestions on some programs that dis-assemble into what we humans call "english"?
Compilation is a very lossy process, so you can't expect much out of disassembly.
Forum: C++ Dec 31st, 2004, 9:37 AM
Replies: 15
Views: 368
Posted By Tama
>that sounds a lot like re-inventing the...

>that sounds a lot like re-inventing the wheel.
What does? Writing a toy vector class to help someone understand what it is? Or the standard vector class trying to replace arrays?
Forum: C++ Dec 31st, 2004, 7:53 AM
Replies: 15
Views: 368
Posted By Tama
>these link might be usefull if i know what...

>these link might be usefull if i know what vectors are first
It's basically a dynamic array class. The name vector was used because array is a common class name and vector is a convenient...
Forum: C++ Dec 30th, 2004, 9:46 AM
Replies: 15
Views: 368
Posted By Tama
http://www.cppreference.com/cppvector.html

http://www.cppreference.com/cppvector.html
Forum: C++ Dec 30th, 2004, 9:44 AM
Replies: 3
Views: 164
Posted By Tama
>Would it not be possible to convert directly to...

>Would it not be possible to convert directly to an usigned char which would then be passed to the iptos function for printing?
Yes, but only if iptos accepted a pointer to unsigned char and you knew...
Forum: C++ Dec 29th, 2004, 6:09 PM
Replies: 16
Views: 418
Posted By Tama
>Supposedly it counts input lines A line is any...

>Supposedly it counts input lines
A line is any sequence of characters ending with '\n'. The code as posted counts the number of characters, not the number of lines.

>while (getchar() !=...
Forum: C++ Dec 29th, 2004, 11:22 AM
Replies: 3
Views: 164
Posted By Tama
It's a nonportable hack that happens to be...

It's a nonportable hack that happens to be dangerous as well. But assuming that nothing untoward happens, here's how it works:

struct sockaddr has two members, first a two byte short, then an array...
Forum: C++ Dec 29th, 2004, 11:09 AM
Replies: 12
Views: 414
Posted By Tama
>if (index = 0 ||index = 1||index = 2) = is...

>if (index = 0 ||index = 1||index = 2)
= is assignment, == is comparison. I would be very surprised if you wanted assignment as an if condition. So you should change your code to this:

if (index ==...
Forum: C++ Dec 28th, 2004, 4:29 PM
Replies: 2
Views: 167
Posted By Tama
Probably. What do you need it for and what are...

Probably. What do you need it for and what are the exact requirements?
Forum: C++ Dec 28th, 2004, 4:27 PM
Replies: 12
Views: 414
Posted By Tama
>string word; This is C++, the OP wanted C. >I...

>string word;
This is C++, the OP wanted C.

>I need to put words from a txt file into a linked list.
It's surprisingly easy once you get a feel for it, but until then you'll feel lost. If you're...
Showing results 1 to 37 of 37

 
Forum Jump



DaniWeb IT Discussion Community
All times are GMT -5. The time now is 1:16 AM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC