2d array, using calloc in C

后端 未结 4 1298
长情又很酷
长情又很酷 2021-01-28 17:54

I\'m trying to create a 2D array of chars to storage lines of chars. For Example:

lines[0]=\"Hello\";
lines[1]=\"Your Back\";
lines[2]=\"Bye\";

4条回答
  •  轮回少年
    2021-01-28 18:17

    You tagged the question with C++ -- why not use a std::vector > for this?

    Looking at the compiler error, it looks like you're missing a semicolon before one of your for loops -- the code you posted seems to work perfectly fine here.

提交回复
热议问题