Is there a command to check if a string exists?

Jun 3, 2010 at 7:15pm
Is there a command to check if a string exists?

I'm trying to make a database where you enter a name and it gives you the persons details.
Jun 3, 2010 at 7:17pm
How are you storing the person's details?
Jun 3, 2010 at 7:44pm
There are all kinds of find algorithms and std::string has member functions to do similar things. It really depends on what your database consists of. Even if you are using c-arrays you can still use std algorithms to find substrings or objects with particular properties.
Jun 3, 2010 at 8:05pm
Oh nevermind then I'll explore it myself when I get to algorithms. I didn't know they were needed :p
Jun 3, 2010 at 8:06pm
Comparison between strings is as easy as string == string;, no?

-Albatross
Jun 4, 2010 at 5:13am
But if I have a database of 120 persons, will i have to use 120 if's?
Jun 4, 2010 at 6:18am
No.

But your question is a bit like asking "What colour is a piece of string?".

Well it depends on which tin of paint you dunk it in...

Topic archived. No new replies allowed.