Riallacciandomi a quello che ha detto MItaly, se ci sono problemi qua c'è un esempio in C++. Ma a cosa ti serve?

codice:
#include <vector>
#include <string>
#include <algorithm>
#include <sstream>




std::vector <unsigned> IPtoBin( std::string &text )
{
	delDot( text );

	return dectobin( stouint(text) );
}



void delDot( std::string &text )
{
	std::string::size_type pos = text.find(".");
	
	while( pos != std::string::npos )
	{
		std::string::const_iterator it = text.begin() + pos;
		text.erase( it );

		pos = text.find(".");
	}
}


unsigned stouint( const std::string &text )
{
	std::stringstream sstream;
	sstream << text;

	unsigned uint;
	sstream >> uint;

	return uint;
}


std::vector <unsigned> dectobin( unsigned uint )
{
	typedef std::vector <unsigned>::size_type VectorSize;

	std::vector <unsigned> binary;

	for( VectorSize value = 1; value <= uint; value *= 2 )
		binary.push_back(value);

	std::reverse( binary.begin(), binary.end() );


	VectorSize myVectSize = binary.size();

	for( VectorSize i = 0; i != myVectSize; ++i )
	{
		unsigned temp = binary[ i ];
		binary[ i ] = uint / binary[ i ];
		uint = uint % temp;
	}

	return binary;
}