Count Number Of Occurrences

DSTR3's Avatar, Join Date: Aug 2011
Newbie Member
I'm trying to get the count of the number of times Content-Type occurs in the data[i] where I stated. I'm new at this and I can't seem to fingd something that's simple enough. Any suggestions are welcome.

Code:
void printRawData(unsigned char *data, int length, int more)
{
int i, c=0;
printf(" -------------IP Data Begins-------------\n");
for (i=0; i<length; i++)
{
if ((data[i]>30 && data[i]<122) || 
(((data[i]==10) || (data[i]==13) || (data[i]==123) || (data[i]==125))
&& (more>0)))
{
printf("%c", data[i]);
//////////////////////////////////////////////////////
////CODE HERE/////////////////////
////////////////////////////////////////////////////
c+=1;
}
else
{
printf("[%i]", data[i]);
c+=3;
if (data[i]>9) c++;
if (data[i]>99) c++;
}
if (c>=47)
{
printf("\n");
c=0;
}
}
}
Muthukumaran like this
0
Syperus's Avatar, Join Date: Sep 2011
Go4Expert Member
I know I'm new to the forums, but I think your question would be best answered in the Programming > C-C++ section. Having said that..I'll take a look at your problem when I'm more sober