Click here to Skip to main content
15,921,279 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
i want to calculate number of vowels in a string but i want to calculate it by using pointers in C# how i do that i am facing problem i no how to do that in C but not getting in C#
Posted
Comments
Sergey Alexandrovich Kryukov 14-Nov-11 20:27pm    
Vowels in what language? Not all of them I hope.
--SA

One way (another would be to use RegEx, but that might be overkill IMHO) to do this would be to iterate through each character in the string and count the number of vowels.

/ravi
 
Share this answer
 
Are you serious? For starters, forget the pointers; they are not needed.

Pointers are accessible only for unsafe code when you pin an object, which is used in a very special cases. If you cannot figure such a simple thing as working with .NET strings, this topic is way too advanced for you. Just see http://msdn.microsoft.com/en-us/library/system.string.aspx[^].

—SA
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900