 Hello friends, I am Sanjay Gupta. In this video, I'm going to demonstrate you how you can count, how many wall and consulates are present in a string using dynamic memory location. Before starting, you can note how you can search my YouTube channel. You can type my name Sanjay Gupta in YouTube search bar. My channel will be available on first page. You can find out various programming related videos and playlists there. You can also download my programming app Techimus, which is available on Google Play. Now I am going to implement the solution of this problem. So first I am including a header file that is STDIO.h. Now I am including a header file that is STDIO.h. Then I am defining the main function. Here I am declaring integer variables that is N, C1 and C2. C1 and C2 are initialized with zero. Then I am declaring a character pointer, which is P. Now to receive size of string, I am going to display a message to printf enter size of string. To read that size from user, I am applying scanf and the entered size will be stored inside n variable. Now I am going to allocate dynamic memory. For that I am calling malloc function. So malloc function is responsible for dynamic memory location here and into size of care through this multiplication. The size of memory will be allocated and the base address will be written that will be typecasted into character pointer and will be stored inside P pointer. Now through P pointer, I can access all the locations of that memory location. So first I am going to print a message that is enter string and user will enter a particular string that will be stored in P pointer through getters. So before getters, I have to call f flush function and I am passing standard in this function. So f flush function will clear the buffer because after reading integers, if I want to read characters, then I have to clean the buffer memory. Then I can call getters and I am passing P inside it. So the enter string will be stored inside P pointer. Now with the help of a loop, I can count how many wall or consonants are available in a string. So I am declaring one more variable that is I. I am initializing I with zero. Now I am implementing while loop and while loop having this condition as stress P plus I not equals to null. So P plus I will be pointing to a location or you can say to a locations address and that address will be D referenced with this as stress sign. So the available value will be checked whether it is equals to null or not. So if it is not equals to null, then loop will be repeated. Otherwise, it will be terminated. So inside this file loop, I can write if as risk P plus I double equals to a. Now I am copying this expression and with our operator, I am pasting it. So here E then or then I then again or then O or U. So this way I have implemented the complete expression in front of you which is checking whether the address is containing A, E, I, O, U or not. So if it is containing A, E, I, O, U, it means the content is all otherwise it is consonant. And here I am only focusing upon uppercase letters. So according to me, the entered characters will be only uppercase letters. If you want to check lowercase also, then you have to type these expressions five times more for lowercase letters. So here I am incrementing C1 and in else part I am incrementing C2 and then I plus plus. So this way I have implemented the logic in front of you. After completion of this loop, I can print the quantities. Wavel equals to percent E slash and consonants equals to percent E then C1 comma C2. Then I can call free function that will be allocated. Sorry, that will be allocated dynamically allocated memory and then return zero. So this way I have implemented complete logic in front of you which is checking how many walls and consonants are present in a string using dynamic memory location. So here it is asking for the size of string. So I'm entering six as input and I am entering India. So you can see the output walls are three and consonants are two. So in India, three walls are available that is IIA and NND. These two letters are consonants. So the output is correct. Program is working properly. So here you can see I have implemented dynamic memory location for string and I have counted walls and consonants that are available in a string. I hope you have understood the logic well. If you want to watch more programming related videos, you can search my YouTube channel by typing my name Sanjay Gupta in YouTube search bar. Here various programming related videos are available. Thank you for watching this video.