C/Visual C - me pueden ayudar con el mostrar de este codigo

 
Vista:

me pueden ayudar con el mostrar de este codigo

Publicado por rene (5 intervenciones) el 03/03/2006 05:11:26
#include <stdlib.h>
#include <stdio.h>
#include <conio.h>
#include <string.h>

#define p printf
#define s scanf

int Memoria;

typedef struct nodo{
struct {
char nombre[1];
}dato;
struct nodo *sig;
struct nodo *ant;
}*tareas;

/***********************************inicializacion lista********************/

void inicializa( tareas tarea){
tarea = new ( struct nodo);
if ( tarea == NULL ){
p("\nERROR al inicializar tareas");
getchar();
}
strcpy ( tarea -> dato.nombre, NULL );
tarea -> sig = NULL;
tarea -> ant = NULL;
}

//////////////////////////////insertar tareas/////////////////////////////////

void insertar ( tareas tarea){
tareas aux;
char A[1];
aux = new ( struct nodo );
p("\nNombre de tarea: ");
fflush(stdin);
s("%s",&A);
strcpy ( aux -> dato.nombre, A);
aux -> sig = tarea -> sig;
aux -> ant = tarea;
if ( tarea -> sig == NULL){
tarea->sig->ant = aux;
}
tarea->sig = aux;
}
////////////////////////////////////Mostrar Tareas/////////////////////////////
void mostrar ( tareas tarea){


}
////////////////////////////////////main///////////////////////////////////////
void main(){
int opcion,memory;
nodo *tarea;
clrscr();
inicializa ( tarea );
p("\nInserta Cantidad de memoria---> ");
fflush(stdin);
s("%d",&memory);
Memoria = memory;
do{
clrscr();
p("\n\t\t\tMemoria == %d ",Memoria);
gotoxy(1,0);
p("\n1 ) Insertar Tareas\n2 ) Mostrar Tareas\n3 ) Salir");
p("\n\n\t\t\t---> ");
fflush(stdin);
s("%d",&opcion);
if ( opcion == 1 ){
insertar(tarea);
}
if ( opcion == 2){
mostrar(tarea);
}
}while ( opcion != 3);

}



de antemano muchisimas gracias
Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder