online compiler and debugger for c/c++

code. compile. run. debug. share.
Source Code   
Language
#include <stdio.h> #include <stdlib.h> #include <string.h> #include <malloc.h> /*------------------------------------------------NODO----------*/ typedef struct Snodo{ char par[25]; struct Snodo* next; }Tnodo; /*------------------------------------------------PUNTATORE AL NODO----------*/ typedef Tnodo* Pnodo; /*------------------------------------------------LISTA----------*/ typedef struct Slista{ Pnodo testa; int N; }Tlista; /*------------------------------------------------PROTOTIPI FUNZIONI----------*/ Tlista crealista(); Tlista aggiungiInTesta(Tlista l,char* T); void stampalista(Pnodo p); /*------------------------------------------------MAIN----------*/ int main() { Tlista l; char testo[2000]; char* token; printf("inserire un testo libero massimo 2000 caratteri:\n"); gets(testo); l=crealista(); token=strtok(testo," "); while(token!=NULL){ l=aggiungiInTesta(l,token); token=strtok(NULL," "); } /*stampa di prova*/ stampalista(l.testa); return 0; } /*------------------------------------------------IMPLEMENTO FUNZIONI----------*/ Tlista crealista(){ Tlista ris; ris.testa=NULL; ris.N=0; } Tlista aggiungiInTesta(Tlista l,char* T){ Pnodo nuovonodo; /*allocazione nuovo nodo*/ nuovonodo=malloc(sizeof(Tnodo)); /*inserimento valore nodo*/ strcpy(nuovonodo->par, T); /*aggiornamento puntatori*/ nuovonodo->next=l.testa; l.testa=nuovonodo; l.N++; return l; } void stampalista(Pnodo p) { if(p == NULL) return; stampalista(p->next); printf("%s ", p->par); }

Compiling Program...

Command line arguments:
Standard Input: Interactive Console Text

                

                

Program is not being debugged. Click "Debug" button to start program in debug mode.

#FunctionFile:Line
VariableValue
RegisterValue
ExpressionValue