- This topic is empty.
Viewing 1 post (of 1 total)
Viewing 1 post (of 1 total)
- You must be logged in to reply to this topic.
› Forums › CS50’s Introduction to Computer Science by Harvard University on Edx › Week 2: [Arrays] – Functions, Variable and Scope, Debugging, Arrays, and Command Line Arguments › To create a new array equal to argv[1][ ] for the temporary storage of values in order to compare the uniqueness of keys
Tagged: arrays
[dm_code_snippet background=”yes” background-mobile=”no” slim=”yes” line-numbers=”yes” bg-color=”#abb8c3″ theme=”dark” language=”clike” wrapped=”yes” height=”” copy-text=”Copy Code” copy-confirmed=”Copied”]
char temp_array[t] = argv[1][];
for (int i = 0; i < 25; i++)
{
for (int j = i; j < 25; j++)
{
temp_array[t] = toupper(temp_array[t]);
printf("capital%c", temp_array[t]);
if (temp_array[t] == temp_array[1][j + 1])
{
printf("keys should be unique");
return 1;
}
}
}
[/dm_code_snippet]
[learn_press_profile]
