C++ Comparison

Namecheap AuctionsNamecheap Auctions
SpaceshipSpaceship
SpaceshipSpaceship
Watch

Lord

Established Member
Impact
13
Hey;

Say my variable string 'a' contained
"A b c d e f g h i j k l m n o p q r s t u v w x y z"

thats the string; spaces included.

I wonna see how many times a certain letter shows up; say 'j'

how would i compare the two strings(pretend they were both strings instead of letters) how would i compare the two strings and seperate each letter in string a into different "words" / figure out how to do this?
 
0
Close
The views expressed on this page by users and staff are their own, not those of NamePros.
GoDaddyGoDaddy
There's a function strtok which can parse a string into tokens separated by spaces ot whatever you want. Or if you just waht to count/compare distinct letters, use char *ptr=your_string, and then ptr[0] is the first character in the string, ptr[1] the second and so on. Character '\0' marks the end of the string.
 
0
Close
CatchedCatched

We're social

Escrow.com
Spaceship
Domain Recover
CryptoExchange.com

NamePros updates

Switch between accounts
You can now stay logged in to more than one NamePros account in the same browser. Click your avatar, then "Accounts in this browser", to...
AIVikings
Catchy
  • The sidebar remains visible by scrolling at a speed relative to the page’s height.
Back