occurrence of string cg in a dna string

hi, i am new to c++. i want to write a program to find the sequence of cg in a dna string. i know we have to find the length and use the loops but i am really confused about subscripting. NEED HELP PLEASE
Subscripting: str[i]
Getting the length: str.length()
Finding a substring: str.find("cg")
http://www.cplusplus.com/reference/string/string/
thanks i have the length but can u please explain a bit about subscripting
thanks
Topic archived. No new replies allowed.