Foros Club Delphi

Foros Club Delphi (https://www.clubdelphi.com/foros/index.php)
-   C++ Builder (https://www.clubdelphi.com/foros/forumdisplay.php?f=13)
-   -   Problema con estructura de C (https://www.clubdelphi.com/foros/showthread.php?t=92630)

aguml 13-12-2017 14:35:51

Problema con estructura de C
 
Hola amigos, tengo esta estructura:
Código PHP:

#define SIZE_LIST_CAT3 7

struct LArmasCat3 {unsigned char valorAnsiString nombre;} ListaArmasCat3[SIZE_LIST_CAT3] = {
        {
0x01"Planta curativa verde"},
        {
0x02"Planta curativa roja"},
        {
0x04"Spray de primeros auxilios"},
        {
0x05"Hierba (verde)"},
        {
0x06"Hierba (Rojo)"},
        {
0x07"Hierba (G + G)"},
        {
0x09"Hierba (G + R)"}
    }; 

Y al compilar me suelta todos estos errores:
Código:

[C++ Error] DefinicionesCadenas.h(370): E2188 Expression syntax
[C++ Error] DefinicionesCadenas.h(370): E2141 Declaration syntax error
[C++ Error] DefinicionesCadenas.h(370): E2190 Unexpected }
[C++ Error] DefinicionesCadenas.h(370): E2190 Unexpected }
[C++ Error] DefinicionesCadenas.h(370): E2040 Declaration terminated incorrectly

Llevo un buen rato dandole vueltas y no se que hago mal ¿pueden ayudarme?

aguml 13-12-2017 16:07:51

Bueno, me autorespondo. El problema era debido al AnsiString ya que este no tiene un tamaño fijo. Lo he sustituido por un array de caracteres y listo.


La franja horaria es GMT +2. Ahora son las 17:15:52.

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Traducción al castellano por el equipo de moderadores del Club Delphi