Question: I have been trying to shuffle this array from characters 3 3 - 1 2 6 , and when i do it , the final
I have been trying to shuffle this array from characters and when i do it the final result adds an extra to it and i dont know why, it is shufflling all the values i want plus a null or character void generatingMixedSoupchar soup
srandtimeNULL;
const int numValidChars ;
char validCharsnumValidChars;
for int i ; i numValidChars ; i
validCharsi i ;
printfvalidCharsdc ASCII CODE: d
i validCharsi validCharsi;
printfc validCharsi;
printf
;
validCharsnumValidChars ;
for int i ; i numValidChars; i
int swapIndex randnumValidChars;
char temp validCharsi;
if validCharsi
validCharsi validCharsswapIndex;
validCharsswapIndex temp;
for int i ; i numValidChars; i
printfvalidCharsdc ASCII CODE: d
i validCharsi validCharsi;
char soup;
for int i ; i ; i
if validCharsi
soupi validCharsi;
printfsoupdc
i soupi;
soup;
printfSoup: s
soup;
void createSoup char soup
printfSoup:
soup;
printfSoup code: ;
for int i ; soupi; i
printfd soupi;
printf
;
int main
char soup;
generatingMixedSoupsoup;
createSoupsoup;
this is the code i dont know what im doing wrong i am frustrated.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
