help me please

I would like covert code c++ to c..

#include<iostream>
#include<string>
using namespace std;

struct node{
string data;
node* next;
node():next(0){ cin>>data; }
};

main(){
node *h,*t,*q,*g,*gg,*p;
h = NULL;
char in;
do{
int i=5; int numofcar=0;
cin>>in;
switch(in){
case 'A' : if(h==NULL){
h = new node ;
t = h ;
t->next=NULL;
cout<<h->data<<" is waiting"<<endl;
}
else{
q = new node ;
t->next = q;
t=q;
t->next=NULL;
cout<<q->data<<" is waiting"<<endl;
}
break;

case 'P' :
p = h;
cout<<"Car is waiting : ";
if(p){
while(p){
cout<<p->data<<' ';
p = p->next;
}
cout<<endl;
}
else{
cout<<"No car"<<endl;
}
break;

case 'G' :
g = h;
while(g){ numofcar++; g=g->next;}
while(numofcar&&i){
gg = h;
h=h->next;
delete gg;
numofcar--;
i--;
}
break;

case 'Q' : cout<<"EXIT!!!"<<endl; break;
}
}
while(in!='Q');
}


There's no C++ code there except for cin and cout and the use of new and delete.

Please use code tags (the <> formatting button) when posting code.
Topic archived. No new replies allowed.