[Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 198
  • Last Modified:

strings into array

if i have a list of names

smith,jason
jackson, joe
davis, bill

how could i put each one of the names into arrayx[]?


arrayx[0]=smith,jason....
0
Kal130
Asked:
Kal130
1 Solution
 
AxterCommented:
Hi Kal130,
You can use a vector of strings.

Example:
#include <vector>
#include <string>
#include <iostream>

std::vector<std::string> MyArray;

MyArray.push_back("smith,jason");
MyArray.push_back("jackson, joe");
MyArray.push_back("davis, bill");

std::cout << MyArray[0] << std::endl;
std::cout << MyArray[1] << std::endl;
std::cout << MyArray[2] << std::endl;


David Maisonave :-)
Cheers!
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now