elhacker.net cabecera Bienvenido(a), Visitante. Por favor Ingresar o Registrarse
¿Perdiste tu email de activación?.

 

 


Tema destacado: Los 10 CVE más críticos (peligrosos) de 2020


+  Foro de elhacker.net
|-+  Programación
| |-+  Programación C/C++ (Moderadores: Eternal Idol, Littlehorse, K-YreX)
| | |-+  [Error] ld returned 1 exit status en mi programa de pilas y colas
0 Usuarios y 1 Visitante están viendo este tema.
Páginas: [1] Ir Abajo Respuesta Imprimir
Autor Tema: [Error] ld returned 1 exit status en mi programa de pilas y colas  (Leído 3,585 veces)
creiko

Desconectado Desconectado

Mensajes: 44


Ver Perfil
[Error] ld returned 1 exit status en mi programa de pilas y colas
« en: 19 Octubre 2016, 07:38 am »

Ola que tal estoy haciendo esto dev c++
pero me sale este error

si alguien me ayuda lo agradeceria

O:\collect2.exe [Error] ld returned 1 exit status


Código
  1.  
  2. #include "stdio.h"
  3. #include "conio.h"
  4. #include "string.h"
  5. #include "windows.h"
  6. #include "stdlib.h"
  7. #include "time.h"
  8. #include "iostream"
  9. #include "stdlib.h"
  10. struct nodo{
  11. int informacion;
  12. struct nodo *siguiente;
  13. };
  14. int menu();
  15. void agregar_nodo();
  16. void listar();
  17. void insertfinal();
  18. nodo *inicio = NULL, *nuevo = NULL, *aux;
  19. main()
  20. {
  21. int opc=0;
  22. while(opc!=8)
  23. {
  24. switch (opc)
  25. {
  26. case 1:
  27. agregar_nodo();
  28. break;
  29.  
  30. case 2:
  31. insertfinal();
  32. break;
  33. case 3:
  34. break;
  35. case 4:
  36. listar();
  37. break;
  38. }
  39. opc=menu();
  40. }
  41. }
  42. int menu()
  43. {
  44. int opc;
  45. printf("\n\n");
  46. printf("1. Agregar elementos al inicio de la lista \n");
  47. printf("2. Agregar elementos al final de la lista \n");
  48. printf("3. Agregar elementos despues de \n");
  49. printf("4. Listar elementos \n");
  50. printf("5. Buscar elementos \n");
  51. printf("6. Eliminar elementos \n");
  52. printf("7. Eliminar lista \n");
  53. printf("8. Fin de la ejecucion \n");
  54. printf("\n\n");
  55. printf("Seleccione una opcion \n");
  56. scanf("%d",&opc);
  57. printf("\n\n");
  58. printf("la opcion elegida es: %d",opc);
  59. printf("\n\n");
  60. return opc;
  61. }
  62. typedef struct nodo *Tlista;
  63. void agregar_nodo()
  64. {
  65. int elem;
  66. printf("ingrese el elemento de la lista \n");
  67. scanf("%d",&elem);
  68. nuevo = new nodo;
  69. nuevo->informacion=elem;
  70. nuevo->siguiente=inicio;
  71. inicio = nuevo;
  72. printf("\n elemento agregado satisfactorimente \n");
  73. }
  74. void listar()
  75. {
  76. aux=inicio;
  77. while(aux!=NULL)
  78. {
  79. printf("\n elemento: %d",aux->informacion);
  80. aux = aux -> siguiente;
  81. }
  82. }
  83. void insertfinal(int elem,nodo *lista)
  84. {
  85. nodo *nuevo, *aux2=lista;
  86. nuevo = new nodo;
  87. nuevo->informacion = elem;
  88. nuevo->siguiente = NULL;
  89. if(aux2 == NULL)
  90. {
  91. lista = nuevo;
  92. }
  93. else
  94. {
  95. while(aux2->siguiente != NULL)
  96. {
  97. aux2 = aux2->siguiente;
  98. }
  99. aux2->siguiente = nuevo;
  100. }
  101. }
  102.  
  103.  


En línea

Páginas: [1] Ir Arriba Respuesta Imprimir 

Ir a:  

Mensajes similares
Asunto Iniciado por Respuestas Vistas Último mensaje
[Error] ld returned 1 exit status, Ayuda soy nuevo en C
Programación C/C++
rkrdto 2 7,364 Último mensaje 23 Enero 2015, 08:40 am
por Almamu
[ERROR] Id Returned 1 exit status
Programación C/C++
Wolfman19951 3 6,012 Último mensaje 3 Agosto 2015, 09:26 am
por do-while
[Error] ld returned 1 exit status
Programación C/C++
wallcroft 1 3,363 Último mensaje 9 Mayo 2016, 20:09 pm
por MAFUS
[Error] ld returned 1 exit status
Programación C/C++
Franco2410 7 5,697 Último mensaje 9 Octubre 2016, 18:41 pm
por engel lex
no carga mi programa " error: ld returned 1 exit status"
Programación C/C++
AlexFKFLores 1 2,475 Último mensaje 28 Marzo 2017, 08:58 am
por MAFUS
WAP2 - Aviso Legal - Powered by SMF 1.1.21 | SMF © 2006-2008, Simple Machines