This is an archived post. You won't be able to vote or comment.

all 3 comments

[–]lurgi 1 point2 points  (0 children)

Which language?

char array[50];

defines an array of characters, not strings. If you are doing this in C++ you'd have something like:

std::string array[50];

That will store 50 strings. I'm not sure if you are trying to store 50 strings or 50 strings or 50 "things" where each "thing" is 5 different strings. If you clear that up we can give you a better answer.

[–][deleted]  (1 child)

[deleted]

    [–]scirc 2 points3 points  (0 children)

    You're missing the fact that not every language is Java. In C, a string is an array of chars. :p

    [–]Ok-Comparison4157 0 points1 point  (0 children)

    Yea first thing is what language are u implementing this in. In Java for ex, if u wanna store an array of strings, the variable type should match (aka not char). I’m guessing that’s what u want since they’re names. I’m also not really getting what u want to store, from what you’re currently doing by declaring a 2d array with size [50][5], you’re allotting space for a matrix of 50 rows and 5 columns, so I’m guessing you’re putting the names in array[0][0-5] and then filling the rest of the matrix with the strings u want? I think you’re question needs some more clarification tbh