Question: Please convert this following C++ program into C. Thank you for the help Contacts.cpp #include #include Contacts.h using namespace std; ContactNode::ContactNode(){ nextNodePtr=NULL; } ContactNode::ContactNode(string name,
Please convert this following C++ program into C.
Thank you for the help
Contacts.cpp
#include
void ContactNode::InsertAfter(ContactNode *nextNode){ ContactNode *temp; if(nextNodePtr==NULL) nextNodePtr=nextNode; else{ temp=nextNodePtr; while(temp!=NULL){ temp=temp->GetNext(); } temp=nextNode; } }
string ContactNode::GetName(){ return contactName; }
string ContactNode::GetPhoneNumber(){ return contactPhoneNum; }
ContactNode* ContactNode::GetNext(){ return nextNodePtr; }
void ContactNode::PrintContactNode(){ ContactNode *temp; cout<<"Contact Name: "<
Contacts.h
#ifndef Contact_H #define Contact_H #include
Main.cpp
#include
int main(){ ContactNode contactList; string name; string phoneNum; for(int i=0;i<3;i++){ cout<<"Enter name: "; cin>>name; cout<<"Enter phone number: "; cin>>phoneNum; contactList.InsertAfter(new ContactNode(name,phoneNum)); } cout<
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
