Muchas gracias, aunque en ese caso estaría guardando la cadena con un salto de linea, ¿no?
Esta sección te permite ver todos los mensajes escritos por este usuario. Ten en cuenta que sólo puedes ver los mensajes escritos en zonas a las que tienes acceso en este momento.
Mostrar Mensajes Menú
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
typedef char *strings;
int main(){
strings info_variable[4];
fgets(info_variable[0],30,stdin);
printf("%s",info_variable[0]);
getchar();
return 1;
}
#include <stdio.h>
#include <stdlib.h>
typedef struct _nodo {
int dni;
int fecha;
struct _nodo *siguiente;
} tipoNodo;
void leer_fic(){
FILE *fp;
tipoNodo *aux;
int a = 0;
fp = fopen("pacientes.txt","r+b");
while(!feof(fp)){
a = fread(&aux,sizeof(tipoNodo),1,fp);
if(a != 0){
puts("LECTURA!");
printf("DNI:%d\n",aux->dni);
printf("FECHA:%d\n",aux->fecha);
printf("%d\n",a);
puts("FIN DE LECTURA\n");
}
}
fclose (fp);
}
int main(){
leer_fic();
getchar();
return 0;
}
typedef struct _nodo {
int dni;
int fecha;
struct _nodo *siguiente;
} tipoNodo;
typedef tipoNodo *pNodo;
typedef tipoNodo *Lista;
typedef struct _nodo {
int dni;
int fecha;
struct _nodo *siguiente;
}tipoNodo;
int main(){
tipoNodo *pNodo;
tipoNodo *Lista;
}
void leer_fic(){
FILE *fp;
tipoNodo *aux;
while(!feof(fp)){
fp = fopen("pacientes.txt","r+b");
fread(&aux,sizeof(tipoNodo),1,fp);
puts("LECTURA!");
printf("DNI:%d\n",aux->dni);
printf("FECHA:%d\n",aux->fecha);
puts("FIN DE LECTURA");
aux = aux->siguiente;
getchar();
}
fclose (fp);
}