Menu

 
Reply to this topicStart new topic
> podem ajudar-me sff? c++
V
vanessa17
post May 6 2008, 09:16 AM
Post #1




Grupo: Membro
Posts: 1
Registado: 6-May 08
De: Mirandela
Membro nº: 25,845



oix começei agora a pouco tempo a aprender winsock e gostava q me dissesem o que está errado aqui neste codigo:



#include <iostream>

#include <winsock>

int main(){

    WSADATA wsaData;

  if (WSAStartup(MAKEWORD(1,0),&wsaData) !=0){

   cout << "erro a iniciar winsock" << endl;}  

  char ip[80];

  char hname[80];

  gethostbyaddr(ip,sizeof(ip),0);

  gethostbyname(hname);

  cout << " O Hostname é " << hname << endl << "O Ip é: " << ip;

  return 0;

}


qnd executo aparecem simbolos estranhos no lugar do ip e do host. o Objectivo é aparecer meu o ip e o hostname, e ja agora,podiam me tambem dizer 1 site de referencia a winsock? é que estou a fazer por tentativas e dava jeito.
Obrigada, bjs
Go to the top of the page
 
+Quote Post

Reply to this topicStart new topic

 

Publicidade
who's online
Versão Simples
Skin by IPB Customize
Horário: 5th December 2008 - 01:55 AM