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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started