elhacker.net cabecera Bienvenido(a), Visitante. Por favor Ingresar o Registrarse
¿Perdiste tu email de activación?.

 

 


Tema destacado: Introducción a Git (Primera Parte)


  Mostrar Mensajes
Páginas: 1 ... 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 [24] 25 26 27 28 29 30
231  Programación / Programación C/C++ / Re: Error Socket?? en: 29 Junio 2011, 00:47 am
Mira qué bien ;D.
232  Programación / Programación C/C++ / Re: Error Socket?? en: 29 Junio 2011, 00:09 am
Pensaba que trabajabas con los sockets de Windows, entonces close sí existe. No sé, te voy a decir como ultimátum que cambies el tercer parámetro por un puntero a socklen_t :

Citar
a pointer to a socklen_t location that specifies the size of the client address structure passed to accept(). When accept() returns, this location indicates how many bytes of the structure were actually used.
233  Programación / Programación C/C++ / Re: Error Socket?? en: 28 Junio 2011, 23:54 pm
Además de que no sé de dónde has sacado la función close...
234  Programación / Programación C/C++ / Re: Error Socket?? en: 28 Junio 2011, 23:53 pm
¿No te da errores, si no incluyes las librerías?

No sé, depura y mira qué pasa. Te debería funcionar, si no, crea un nuevo proyecto.
235  Programación / Programación C/C++ / Re: Error Socket?? en: 28 Junio 2011, 23:20 pm
Teóricamente te debería compilar, si introdujeras las bibliotecas correspondientes. ¿Cómo compilaste?

Además de que no sé de dónde has sacado la función close...
236  Programación / Programación C/C++ / Re: Duda sobre c++ en: 28 Junio 2011, 20:35 pm
Con que programa se programa en c++?

Con cualquier editor de texto ;D. Vas a necesitar un compilador (http://en.wikipedia.org/wiki/List_of_compilers#C.2B.2B_compilers) y quizás un linker (enlazador) pero bueno...

Igualmente, si vas a empezar, existen entornos de desarrollo integrados (http://en.wikipedia.org/wiki/Integrated_development_environment) que están equipados de estos programas que te mencioné antes y te facilitan la vida. Hay montones de IDEs, pero dependiendo del sistema operativo en el que vayas a trabajar, hay un par que están muy bien:


Finalmente, te dejo un enlace a una chincheta del foro de C/C++ en la cual hay muchos libros de estos lenguajes:

http://foro.elhacker.net/programacion_cc/librospapers_cc-t296234.0.html

Mi recomendación personal es que si realmente vas a adentrarte en C++ uses un libro (preferentemente en papel) + foro + http://www.cplusplus.com/.
237  Programación / Programación C/C++ / Re: Ayuda en la validación de entrada de datos en C++ en: 28 Junio 2011, 15:41 pm
Primeramente, déjame decirte de nuevo que tienes el bucle mal. El esquema y la intención son muy buenos pero lo tienes que hacer tal y como Therue mencionó. Pégale un repaso a los operadores de C/C++:

http://en.wikipedia.org/wiki/Operators_in_C_and_C%2B%2B

Finalmente, para comprobar si has introducido un número o una cadena, puedes usar la función atoi (http://www.cplusplus.com/reference/clibrary/cstdlib/atoi/). Te dejo un pequeño código para que lo entiendas mejor:

Código
  1. #include <cstdio>
  2. #include <cstdlib>
  3. #include <cstring>
  4.  
  5. int main()
  6. {
  7. char string[50];
  8.  
  9. fgets(string, 50, stdin);
  10.  
  11. if(string[strlen(string) - 1] == '\n')
  12. string[strlen(string) - 1] = '\0';
  13.  
  14. int integer = atoi(string);
  15.  
  16. if(integer == 0)
  17. {
  18. printf("\n");
  19.  
  20. main();
  21. }
  22.  
  23. else
  24. printf("%d", integer);
  25.  
  26. //O lo que sea
  27.  
  28. getchar();
  29.  
  30. return 0;
  31. }


PD: ¿No te da errores tu código? ¿Qué compilador estás usando?
238  Programación / Programación C/C++ / Re: Programa para Llevar de TB a GB,MB,KB... en: 27 Junio 2011, 12:19 pm
Citar
5.1.2.2.1 Program startup
1 The function called at program startup is named main. The implementation declares no
prototype for this function. It shall be defined with a return type of int and with no
parameters:
int main(void) { /* ... */ }
or with two parameters (referred to here as argc and argv, though any names may be
used, as they are local to the function in which they are declared):
int main(int argc, char *argv[]) { /* ... */ }
or equivalent;9) or in some other implementation-defined manner.
2 If they are declared, the parameters to the main function shall obey the following
constraints:
— The value of argc shall be nonnegative.
— argv[argc] shall be a null pointer.
— If the value of argc is greater than zero, the array members argv[0] through
argv[argc-1] inclusive shall contain pointers to strings, which are given
implementation-defined values by the host environment prior to program startup. The
intent is to supply to the program information determined prior to program startup
from elsewhere in the hosted environment. If the host environment is not capable of
supplying strings with letters in both uppercase and lowercase, the implementation
shall ensure that the strings are received in lowercase.
— If the value of argc is greater than zero, the string pointed to by argv[0]
represents the program name; argv[0][0] shall be the null character if the
program name is not available from the host environment. If the value of argc is
greater than one, the strings pointed to by argv[1] through argv[argc-1]
represent the program parameters.
— The parameters argc and argv and the strings pointed to by the argv array shall
be modifiable by the program, and retain their last-stored values between program
startup and program termination.

9) Thus, int can be replaced by a typedef name defined as int, or the type of argv can be written as
char ** argv, and so on.
239  Programación / Programación C/C++ / Re: COMPILADOR DE C++ en: 27 Junio 2011, 10:42 am
El compilador que usa Visual C++ (http://en.wikipedia.org/wiki/Visual_C%2B%2B).
240  Programación / Programación C/C++ / Re: Como ponerle icon al .exe compilado ? C++ en: 27 Junio 2011, 10:15 am
http://stackoverflow.com/questions/320677/how-do-i-set-the-icon-for-my-application-in-visual-studio-2008
Páginas: 1 ... 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 [24] 25 26 27 28 29 30
WAP2 - Aviso Legal - Powered by SMF 1.1.21 | SMF © 2006-2008, Simple Machines