 |
www.es-minix.org Foros de discusión en español, sobre el sistema operativo Minix
|
| View previous topic :: View next topic |
| Author |
Message |
damaya Usuario
Joined: 23 Jul 2006 Posts: 12
|
Posted: Sat Sep 23, 2006 1:56 pm Post subject: |
|
|
| efutch wrote: | | damaya wrote: |
[*]Estructura de la Estructura...
esta es la sintaxis de una estructura normal:
| Code: | struct [<identificador>] {
[<tipo> <nombre_variable>[,<nombre_variable>,...]];
.
} [<variable_estructura>[,<variable_estructura>,...]; |
notar donde va el nombre de la estructura y donde van las instancias.
|
Las estructuras declaradas en esta forma se llaman "anonymous structures" ó "unnamed structures" y son legales en ANSI C. La notación que usted muestra en BNF lo indica claramente al señalar que el tag de la estructura (el primer <identificador>) es opcional al estar encerrado entre corchetes.
|
la Estructura no tiene nombre pero si tiene declarada 1 variable de nombre counting_semaphore.
Yo creo que la siguiente instrucion no es valida, corriganme si me equivoco.
| Code: | | counting_semaphore empty=buf_size,full=0; |
|
|
| Back to top |
|
 |
efutch Administrador
Joined: 04 Jun 2006 Posts: 257 Location: Tegucigalpa, Honduras
|
Posted: Mon Sep 25, 2006 12:25 pm Post subject: |
|
|
| damaya wrote: |
la Estructura no tiene nombre pero si tiene declarada 1 variable de nombre counting_semaphore.
Yo creo que la siguiente instrucion no es valida, corriganme si me equivoco.
|
En este caso usted tiene razón, y falta el typedef. La declaración debería decir entonces:
| Code: | | typedef struct {int valor; } counting_semaphore; |
Saludos,[/code] |
|
| Back to top |
|
 |
|
|
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 vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|