jueves, 15 de marzo de 2012

Varios temas

Programa para movilizar el *
#include <iostream.h>#include <conio.h>#include <conio.h> void
{


clrscr();
x=40;
y=12;
gotoxy(x,y);
cout<<
 
tecla = getch();
main()int tecla;int x,y;"*";//captura la tecla presionada y devuelve el numero//del codigo ascii
{
y=y-1;
}
gotoxy(x,y);
cout<<
getch();
}
if (tecla==101)"*";

Tipos de datos
C++ tiene los siguientes tipos fundamentales:
  • Caracteres: char (también es un entero), wchar_t
  • Enteros: short, int, long, long long
  • Números en coma flotante: float, double, long double
  • Booleanos: bool
  • Vacío: void

·         TIPO DATO ESPACIO MEMORIA RANGO
·         unsigned char  8 bits 0 a 255
·         char 8 bits -128 a 127
·         short int 16 bits -32,768 a 32,767
·         unsigned int 32 bits 0 a 4,294,967,295
·         int 32 bits -2,147,483,648 a 2,147,483,647
·         unsigned long 32 bits 0 a 4,294,967,295
·         enum 16 bits -2,147,483,648 a 2,147,483,647
·         long 32 bits -2,147,483,648 a 2,147,483,647
·         float 32 bits 3.4 x 10-38 a 3.4 x 10+38(6 dec)
·         double 64 bits 1.7 x 10-308 a 1.7*10+308(15 dec)
·         long double 80 bits 3.4 x 10-4932 a 1.1 x 10+4932
·         void sin valor
Para manejar cadenas de caracteres (strings), se debera usar un arregllo de caracteres con el siguiente formato.
Char nomstring[cant de elementos];
Ejemplo
Char nombre[30];
Char ciudad[20];
Para cargar con un dato se usa el siguiente codigo;
strcpy(carrera,”ing sistemas”);

Varios Temas

Codigo para el programa

#include
<iostream.h>#include <conio.h>#include <conio.h> void
{


clrscr();
x=40;
y=12;
gotoxy(x,y);
cout<<
 
tecla = getch();
main()int tecla;int x,y;"*";//captura la tecla presionada y devuelve el numero//del codigo ascii si presionamos la letra "e' devuelve 101
{
y=y-1;
}
gotoxy(x,y);
cout<<
getch();
}

Les dejo algunos turoriales
para que fundamente la teoria

http://www.slideshare.net/slent/manual-c-4918796          descarguen este manual que lo utilizaremos como libro de texto

http://www.cplusplus.com/doc/tutorial/

http://www.jorgesanchez.net/programacion/manuales/programacion2005.pdf

http://descargas.abcdatos.com/tutorial/descargarL257.html

http://mat21.etsii.upm.es/ayudainf/aprendainf/Cpp/manualcpp.pdf
if (tecla==101)"*";