It's a language question!!

Asked 2 years ago, Updated 2 years ago, 35 views

char* arr[34] = { "0","1", "2", "3", "4",.....,"33" };

I'm going to put 0-33 in the arr arrangement Rather than hitting it one by one, I want to turn the for statement around and implement it

c

2022-09-22 19:58

1 Answers

char arr[34][3];

for (int i = 0; i < 34; i++)
    sprintf_s(arr[i], 3, "%d", i);

I did this because it's easier to use a two-dimensional array than a pointer array. If you have to use a pointer, you can make a pointer and use it.


2022-09-22 19:58

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.