All pastes #631664 Raw Edit

Miscellany

public c v1 · immutable
#631664 ·published 2007-07-24 05:27 UTC
rendered paste body
	//Проще всего заменить на	printf("%s ", inet_ntoa(a1));	printf("%s\n", inet_ntoa(a2));		//Правильней, конечно, но в конкреном примере незачем	strcpy(s1, inet_ntoa(a1));	strcpy(s2, inet_ntoa(a2));	printf( "%s %s\n", s1, s2);		//А *лучше* по-моему так. Почему - объяснить?	printf("%d.%d.%d.%d %d.%d.%d.%d\n", 		(a1.s_addr & 255), (a1.s_addr >> 8 & 255), (a1.s_addr >> 16 & 255), (a1.s_addr >> 24 & 255),		(a2.s_addr & 255), (a2.s_addr >> 8 & 255), (a2.s_addr >> 16 & 255), (a2.s_addr >> 24 & 255)	);