ROBOTC.net forums
http://www.robotc.net/forums/

Cannot Initialize a structure
http://www.robotc.net/forums/viewtopic.php?f=63&t=19539
Page 1 of 1

Author:  johnslai [ Mon Nov 14, 2016 1:16 am ]
Post subject:  Cannot Initialize a structure

1) If you are getting an error, please tell us what error you are getting and what he message says.
Code:
typedef struct type_u {
  int b;
} type_u;
typedef struct type_t {
  int a;
  type_u u;
} type_t;

type_t var_t = {
 /* .a = */ 1,
 /* .u = */ { 2, },
};


When compiling, got the following error message:
Quote:
*Warning*:Invalid '=' operation for types 'type_t' and 'char'
*Warning*:Invalid '=' operation for types 'type_t' and 'char'


2) Give us the version of ROBOTC you're using
4.55 (9110) (F/W 10.55)

3) Give us the platform type (NXT, VEX CORTEX, etc.)
VexIQ

4) Describe the issue as best as you can
Compiler is not aware of allocating and initializing a static structure

5) Give us steps on how to reproduce the problem
Use code provided and compile

6) Provide a screenshot if it applies
N/A

7) Tell us the operating system you are using
Windows 10

Page 1 of 1 All times are UTC - 5 hours [ DST ]
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/