c++ check if string contains a character or not and how to convert a binary string into integer

StackOverflow https://stackoverflow.com/questions/13473238

Domanda

I have a binary string like "01001111111". I want to know that if that string contains "0" or not. How to do that ? And if I want to convert it into integer, how to get that ?

È stato utile?

Soluzione

Since this seems to be a homework, so giving complete solution would not be a nice idea.

However, I would give you this hint:

These two together should solve your problem if you learn to use them cleverly.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top