www.es-minix.org Forum Index www.es-minix.org
Foros de discusión en español, sobre el sistema operativo Minix
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Tarea #3 - Semáforos contadores
Goto page Previous  1, 2
 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    www.es-minix.org Forum Index -> Sistemas operativos I - 2006 - 2o. semestre
View previous topic :: View next topic  
Author Message
damaya
Usuario


Joined: 23 Jul 2006
Posts: 12

PostPosted: Sat Sep 23, 2006 1:56 pm    Post subject: Reply with quote

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
View user's profile Send private message
efutch
Administrador


Joined: 04 Jun 2006
Posts: 257
Location: Tegucigalpa, Honduras

PostPosted: Mon Sep 25, 2006 12:25 pm    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    www.es-minix.org Forum Index -> Sistemas operativos I - 2006 - 2o. semestre All times are GMT - 6 Hours
Goto page Previous  1, 2
Page 2 of 2

 
Jump to:  
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