 Hello friends, I am Sanjay Gupta. In this video, I am going to demonstrate you how you can count upper case, lower case, digits and spatial symbols available in string with the help of pointers. 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 Techimage which is available on Google Play. Now I am going to implement the solution of this problem. So here I am using strings and pointers together. So first of all, I am including a header file. Now inside main function, first I am declaring a character array that is str and a pointer p through which I will be processing this str character array. Now I am declaring some variables C1, C2, C3 and C4. Both all four variables are initialized with zero. Then with the help of printf the message enter string will be displayed on console and the enter string will be stored inside str with the help of getters function. Now I have to assign base address of this character array str in p pointer. So remember that name of array provides base address. So here str is name of array and it is providing base address that will be stored inside p pointer. Now through p pointer, I can access all the locations of the character array that is str. So I am applying a while loop here. The condition is strp not equals to null. So here p is containing base address of the character array. So to receive values, I am using this str symbol. So this str symbol will dereference the pointer and it will provide the values available on a particular address. So if it is not equals to null then this loop will repeat. Otherwise loop will be terminated. Now inside this loop, I have to apply some conditions for checking uppercase, lowercase, digits and spatial symbols. So first condition is strp greater than equals to 65 and strp less than equals to 90. So this condition is for uppercase. If it is true then the character which is available on the address which is stored inside p that contains uppercase letter. So I am incrementing c1 by 1. Otherwise I have to check strp for lowercase. So for that purpose, I am applying strp greater than equals to 97 and strp less than equals to 122. So this is the ascii range for lowercase letters. If it is true then c2 will be incremented. Otherwise strp greater than equals to 48 and strp less than equals to 57. These ascii values are for digits. If it is true then c3 will be incremented. If all the conditions are false then pointer is pointing to the location which is containing any spatial symbol. So this way I have incremented c4 if all the conditions are false then. Now after checking these conditions, I have to increase the pointer so that it can point to the next locations of the strings. So this way this loop will be checking all the locations for uppercase, lowercase, digits and spatial symbols. Now after completion of this loop, I can print the calculated results on console. So uppercase equals to percenty will be displayed through c1. Now I am copying this printf and I have pasted it four times. So second printf will print lowercase through c2 variable. Then third printf will print digits with the help of c3 and fourth printf will print spatial symbols that are stored inside c4 and at last I am writing return 0. So this way all the calculated values which are available into c1, c2, c3 and c4 will be displayed on console using these four printf statements. So this way I have implemented the solution of this problem. Now I am going to execute this code so that you can understand how it is working. So I am entering mixed information. So see the output. All are printed as two. So now check this string here capital A and capital T is available. So uppercase letters are printed correctly. Lowercase C and R is available. So lowercase letters are two. Digits 4 and 3 are available. So digits are two and spatial symbols hash and percent is available. So spatial symbols are two. So this way program is working properly. It is properly counting how many uppercase lowercase digits and spatial symbols are available and processing is done with the help of pointer. So this way I have accessed all the locations of string through pointer. Remember that the pointer is of character type so that it can access all the locations of this character easily because whenever we increase a pointer it increase according to its data type. So variable and pointer both will be of same type if you are storing address of that variable into a pointer. So this way I have calculated the requirement which is given in the first statement of this program. So I have calculated the requirement of this program through strings and pointers. If you want to watch more programming related videos you can follow or subscribe my youtube channel through the url youtube.com slash sanjay gupta underscore tech school. You can download my programming app Techimace which is available on google play. Thank you for watching this video.