Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "stdio.h"
- #include "stdlib.h"
- #include "string.h"
- /*
- voglio creare una lista di macchine con nome e velocità
- aggiungere
- eliminare
- ordinare in base alla velocità
- */
- typedef struct S_RacingCar {
- char name[12];
- int speed;
- struct S_RacingCar *next;
- struct S_RacingCar *previous;
- } RacingCar;
- void stampa()
- {
- printf("La lista è\n");
- }
- void addcar()
- {
- printf("add car\n");
- }
- int main(){
- char comando[16];
- char input[16];
- while( fgets(input, 15, stdin)){
- sscanf(input, "%s", comando);
- if(strncmp(comando, "quit", 4) == 0)
- {
- printf("\n\n se vedemo \n");
- break;
- }else if( strncmp(comando, "stampa", 6) == 0){
- stampa();
- }else if( strncmp(comando, "aggiungi", 8) == 0){
- addcar();
- }
- }
- printf("diocane\n");
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement