#include <stdio.h> #include <tchar.h> #include <strstream> using namespace std; int _tmain(int argc, _TCHAR* argv[]) { char dot; char buffer[4]; strstream strs; strs << "172.24.41.40"; strs >> buffer[3]>>dot>>buffer[2]>>dot>>buffer[1]>>dot>>buffer[0]; printf("%d",*((int*)buffer)); return 0; }
int buffer[4];
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)