So im making this program where i have to manage passangers and stations with a few variables.
Im now making the passanger.c i need to make 3 functions: 1 to create a passanger 1 destroy and another read points.
Im kinda rusty on strings:
passanger criaPassanger("how do i insert the strings here" int pts,int ue) and in the function. thanks
Code:
#include "passanger.h"
#include <stdlib.h>
typedef struct _passanger{
char Name[40];
char Email[40];
int points;
int last station;
}infoPassanger, *apPassanger;
passanger createPassanger( int pts,int ue){
apPassanger pas;
pas=(apPassanger) malloc(sizeof(infoPassanger));
pas->points=pts;
pas->laststation=ue;
return (passanger)pas;
}
void destroyPassenger(passenger p){
free(p);
int readPoints(passanger p){
apPassanger p2;
p2 = (apPassanger)p;
return(p2->points);