Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<stdio.h>
- int main(void)
- {
- char *pKazalec = "Primer besedila v pointerju";
- char *pZnak = NULL, *pZnak2 = NULL, *iPonovitev = NULL;
- int iStevec1 = 0;
- pZnak = pKazalec;
- while(*pZnak)
- {
- iPonovitev = pZnak;
- if(*iPonovitev == *(pZnak + 1))
- {
- iStevec1++;
- pZnak2 = iPonovitev;
- }
- if(*iPonovitev < *(pZnak + 1))
- {
- iPonovitev = (pZnak + 1);
- }
- printf("%c", *pZnak);
- pZnak++;
- }
- printf("Najveckrat se ponovi: %c, %d krat", *iPonovitev, iStevec1);
- getch();
- }
Add Comment
Please, Sign In to add comment