I am confused between things like char* v and char v, and how to use them.
I heard that C++ doesn't use things like char* v. Is that true ?
Well. c++ does use char* v
Looks like you haven't learnt about pointers. i suggest you read about them.
When you declare a character as char v, you declare a variable v which hold a single character in it.
For eg- char v='c';
char *v is how you declare a pointer to a character. here *v will contain the memory location[and not the value of the character]. This memory location will contain a single character.
For eg
char c='y';
char *v=&c;//& is address of operator
not on printing c, you get 'y'. on printing v you get the address of memory location c.
printing *v gives you y as well.
Character pointers are commonly used for strings. They point to the 1st character of the string. Using pointer arithmetic, you can so to the other elements in the character array[string]
Comment