Quantcast
Channel: Programming Forums
Viewing all articles
Browse latest Browse all 51036

2d Array searching etc

$
0
0
I cant get my head around this for some strange reason.
Im trying to create a database which asks the user for names and then the program saves this and they can search delete etc.
I cant seem to get ot working any help
thanks.

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


void enterentry()
{

char name[256], age[256];

cout<< "Please Enter Your Name:";
cin.getline (name,256); 

cout<< "Please Enter Your Age:";
cin.getline(age,256);

cout << name << " 's Age is:"<<age;
}


void search()
{
}


void delete()
{
}

void menu()
{
cout<< " 1 - Enter New Member:"<<endl;
cout<< " 2 - Search Existing Member:"<<endl;
cout<< " 3 - Delete Member Profile:"<<endl;
}



int main()
{

	bool end =true
		while (end==true){


	menu();
	int choice;
	cin>>choice;
	if(choice==1){
		enterentry();
	else if (choice==2){
		search();
	else if (choice==3}{
		deleteentry();
	}

	cout<<"exit?"<<endl;
	cout<<"1 - yes"<<endl;
	cout<<"2 - no"<<endl;
	int exitstate;
	cin>>exitstate;
	if (exitstate==1){
		end= !end;
	}
	else if (exitstate==2){
		end==true;
	}
	else {break;}
	

cin.get();
return 0;




Viewing all articles
Browse latest Browse all 51036

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>