Not necessarily a bug, but a request none-the-less, and it's really easy to work-around.
Code:
// These three initializations should be identical char *buff = { 'a', 'b', 'c' }; char buffer[] = { 'a', 'b', 'c' }; char *sbuff = "abc";
task main() { }
The last two work fine, but the first fails.
Your code doesn't look right. buff is declared as a char pointer but the initialization is trying to init an array of char. I just pasted this code to Visual Studio and it gave me the following error. So it is indeed correct for RobotC to reject it.
Code:
1>c:\temp\visual studio 2012\projects\consoleapplication1\consoleapplication1\test.cpp(6): error C2440: 'initializing' : cannot convert from 'char' to 'char *' 1> Conversion from integral type to pointer type requires reinterpret_cast, C-style cast or function-style cast
Users browsing this forum: No registered users and 0 guests
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot post attachments in this forum