I have a question about the sorting and arrays and I have to finish this for exam, but really i am a new student in C and I don't have an idea how to do this:
the question:
Assume that you have a very long string and you are assigned to count the number of occurrences of each character that exists in the string. For example, the string is
"this is supposed to be one damn long character array"
and the two output array should be
"this upoedbnamlgcry"
{2,2,2,4,9,1,2,3,4,2,1,3,5,1,1,1,1,2,1}
Can you write the function that does this?
Shweta LodhaRank #31 · 39.8K reputationPosted Dec 27, 2014, 5:23 AM EST
How are you calculating 2nd array:
VulpesRank #55 · 29.2K reputationPosted Dec 27, 2014, 7:52 AM EST
For example, there are 3 't's in the string and not 2 as shown in the second array.
Also not sure whether code is required in C or C#?
In C it would be:
and in C#:
The output in both cases is:
dizar mejzini4 reputationPosted Dec 27, 2014, 11:08 PM EST
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questionsTop experts