char array[]="aabbcccd";
char type,*count,*cp=array;
while(cp!='\0'){
*cp
is a pointer it's pointing to the address of the start of the array, it will never be ==
to a char '\0'
so it can't leave the loop.
You need to deference the pointer to get what it's pointing at:
while(*cp != '\0') {
...
Also, you have a ;
after your for loop, skipping the contents of it:
for(c=1;*cp==type;c++,cp++); <-- this ; makes it donot nothingexecute the code beneath it
After fixing both of those problems the code produces an output:
mike@linux-4puc:~> ./a.out
a1b1c2cd
Not the one you wanted yet, but that fixes your problems with "printf not functional"