• Advertisement
Sign in to follow this  

Illegal Indirection error...

This topic is 4227 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I am getting error c2100: illegal indirection whenever I try to compile the following line: *buffer[counter]->Attributes = i; Buffer is a CHAR_INFO array pointer, counter is the index, and i is an integer. Also, I know I am gonna get trouble out of the following line: *buffer[counter]->Char.AsciiChar = line; Do I need to use '->' or '.' between Char and AsciiChar? Also line is a string, will that cause problems?

Share this post


Link to post
Share on other sites
Advertisement
Guest Anonymous Poster
Quote:
Original post by -JetSirus-
I am getting error c2100: illegal indirection whenever I try to compile the following line:

*buffer[counter]->Attributes = i;

Buffer is a CHAR_INFO array pointer, counter is the index, and i is an integer.

buffer[counter].Attributes = i;
Quote:
Also, I know I am gonna get trouble out of the following line:
*buffer[counter]->Char.AsciiChar = line;
Do I need to use '->' or '.' between Char and AsciiChar?

Depends on what type Char is.
Quote:
Also line is a string, will that cause problems?

Depends on what types line/AsciiChar are, and what you are going to do with the AsciiChar member. If you are using C++ and they are both std::string's, you should be ok.

Share this post


Link to post
Share on other sites
buffer[counter]->Attributes = i
or
buffer[counter].Attributes = i

Next problem:

buffer[counter]->Char.AsciiChar = line
or
buffer[counter].Char.AsciiChar = line


Which one depends on how buffer is allocates

Use first if
CHAR_INFO* buffer[...];

Use second if
CHAR_INFO buffer[...];


Hope that helps :)

Edit: Didn't see that line is a string... Looking at what I think you mean then it most definately wont work because you would be assigning a char* to a char

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement