Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C++ > the standard and data member value assignment

Reply
Thread Tools

the standard and data member value assignment

 
 
Christopher
Guest
Posts: n/a
 
      09-12-2003
I have been told to complete an assignment in a linux enviroment. I don't
have it so I started up my copy of VS. I am not allowed to alter the files
supplied to me, but only to implement the blanks, blah. well the instructor
made the following statement:

class foo
{
public:
const int MAX_DATA_SIZE = 30;
// ...snipped
};

my compiler doesn't like that idea and gives me an error regarding the
assignment of a value there.
so my question is: what does the standard have to say about the line in
question so that I can justify
my remaking it into a #define or not?

Thanx,
Christopher




 
Reply With Quote
 
 
 
 
Victor Bazarov
Guest
Posts: n/a
 
      09-12-2003
"Christopher" <> wrote...
> I have been told to complete an assignment in a linux enviroment. I don't
> have it so I started up my copy of VS. I am not allowed to alter the files
> supplied to me, but only to implement the blanks, blah. well the

instructor
> made the following statement:
>
> class foo
> {
> public:
> const int MAX_DATA_SIZE = 30;
> // ...snipped
> };
>
> my compiler doesn't like that idea and gives me an error regarding the
> assignment of a value there.


Outdated compiler. Nothing you can do about it, really.

> so my question is: what does the standard have to say about the line in
> question so that I can justify
> my remaking it into a #define or not?


The Standard says it's allowed.

If you aren't supposed to change anything that is already there,
find a better compiler. MinGW should do it (it's basically GCC).

Victor


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
pointer-to-member data and pointer-to-member functions and access specifiers Stephen Howe C++ 2 11-06-2012 12:32 PM
Augument assignment versus regular assignment nagy Python 36 07-20-2006 07:24 PM
Class Member Data and Member Function Parameters - Should Parameters Be Data Members? Jason C++ 2 05-13-2006 07:11 AM
How would I use qsort to sort a struct with a char* member and a long member - I want to sort in order of the long member Angus Comber C Programming 7 02-05-2004 06:41 PM
Beginner's Question: Assignment of Objects with a constant data member possible? CoolPint C++ 5 08-15-2003 05:13 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57