 Hello friends, I am Sanjay Gupta. In this video I am going to demonstrate you how you can count bobble and consonants in string using pointer. Before starting you can note my information, you can follow or subscribe my youtube channel through the url youtube.com slash sanjaygupta underscore tech school. You can download my programming app Techimates which is available on google play. Now I am going to implement solution of this problem with the help of pointer. So first time including header file that is stdio.h. Now I am defining main function. Inside main function I am declaring a counter variable that is c which is initialized with 0. Then I am declaring character array that is str and a character pointer p. Now with the help of printf I am going to display the message enter string on console. The entered string will be received through that is and the contained will be assigned into str. Now I have to process this str character array through pointer. So for that purpose I am assigning base address of string into p pointer. So you have to note that name of array provides base address of the array. So here str is character array and I am assigning its name into p pointer. So its name will be assigning base address of the array into p pointer. Now with the help of p pointer I can access all the locations of str character array. So for that purpose I am starting a loop that is y loop. Here I am applying a condition that is strp not equals to null. So p is holding address and if I want to receive value that is available on that particular address. So I have to dereference this p pointer. So for that purpose I have used this asterisk sign. So this asterisk sign will provide value that is available on a particular address and the address is stored inside p pointer. So if it is not containing null then this loop will be executed otherwise it will be terminated. So inside this loop I am counting sorry I have to apply first if condition because I have to count vowel and consonants. So I am applying if asterisk p double equals to a or asterisk p double equals to e or asterisk p double equals to i or asterisk p double equals to o or asterisk p double equals to u. So this way I have implemented all the vowel as condition in this if. So if any particular condition is true then I can count this variable by one. So here I am modifying this variable. So first is c1 and second one is c2 because I have to count two quantities. If this condition is false then I can count c2 by adding one inside it. So this is for uppercase letters only. If your string contains lowercase letters also then you have to copy this condition and you can paste it like this and change these uppercase letters into lowercase letters. So this way I have implemented total 10 conditions 5 for uppercase letters and 5 for lowercase letters. So if string is containing any particular character which are mentioned in this condition then c1 will be incremented. So c1 is for vowel counting and c2 is for consonant counting. Now after checking this condition I have to increase p pointer so that it can point to the next location which is available inside string. After completion of this while loop I can print the result on console with the help of printf. So for that purpose I am writing these statements. So this way I have implemented the complete code in front of you where I am processing the string with the help of a pointer. Now I am going to execute this code so that you can understand whether it is working properly or not. So I am entering my name Sanjay. So you can see vowels are 2 and consonants are 4. So in my name a occurs twice which are vowel and remaining letters are consonants. So the program is working properly. I am able to count all the vowels and consonants available in string with the help of pointer. So this way I have processed all the locations of string through pointer. I hope you have understood the working of string and pointer with the help of this example. If you want to watch more programming related videos you can follow or subscribe my youtube channel through the URL youtube.com slash sanjaygupta underscore tag school. You can download my programming app tag image which is available on google play. Thank you for watching this video.