Changing an element in a char array
Clash Royale CLAN TAG#URR8PPP
up vote
0
down vote
favorite
Ok. Simple question. Say I have an array:
char *choices =
"Choice 1",
"Choice 2",
"Choice 3",
"Choice 4",
"Choice 5",
"Choice 6",
"Choice 7",
"Choice 8",
"Choice 9",
"Choice 10",
"Exit",
(char *)NULL,
;
How do I ask for input, and have that input automatically change the value of an element in that array without having to do it manually like this:
choices[1] = "345";
c array
add a comment |Â
up vote
0
down vote
favorite
Ok. Simple question. Say I have an array:
char *choices =
"Choice 1",
"Choice 2",
"Choice 3",
"Choice 4",
"Choice 5",
"Choice 6",
"Choice 7",
"Choice 8",
"Choice 9",
"Choice 10",
"Exit",
(char *)NULL,
;
How do I ask for input, and have that input automatically change the value of an element in that array without having to do it manually like this:
choices[1] = "345";
c array
add a comment |Â
up vote
0
down vote
favorite
up vote
0
down vote
favorite
Ok. Simple question. Say I have an array:
char *choices =
"Choice 1",
"Choice 2",
"Choice 3",
"Choice 4",
"Choice 5",
"Choice 6",
"Choice 7",
"Choice 8",
"Choice 9",
"Choice 10",
"Exit",
(char *)NULL,
;
How do I ask for input, and have that input automatically change the value of an element in that array without having to do it manually like this:
choices[1] = "345";
c array
Ok. Simple question. Say I have an array:
char *choices =
"Choice 1",
"Choice 2",
"Choice 3",
"Choice 4",
"Choice 5",
"Choice 6",
"Choice 7",
"Choice 8",
"Choice 9",
"Choice 10",
"Exit",
(char *)NULL,
;
How do I ask for input, and have that input automatically change the value of an element in that array without having to do it manually like this:
choices[1] = "345";
c array
c array
asked 2 mins ago
ignatius
12939
12939
add a comment |Â
add a comment |Â
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f476156%2fchanging-an-element-in-a-char-array%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password