how to assign an element of array of string to different variable in C++?

  arrayofstring, arrays, c++, string

example :

char fruits[][12] = { "apple" , "orange" , "mango" ,  "banana" , "pineapple" }; 

I wanted to store the 2nd index value to a separate variable x.

x = "mango" , for further operation on string "mango".

Source: Windows Questions C++

LEAVE A COMMENT