View program.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Demostración de un constructor predeterminado para la clase Tiempo. | |
#include <iostream> | |
using std::cout; | |
using std::endl; | |
// incluye la definición de la clase Tiempo desde tiempo2.h | |
#include "tiempo2.h" | |
int main() | |
{ |
View Prueba.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
using std::cout; | |
using std::endl; | |
#include <new> | |
class Prueba | |
{ | |
public: |
View Prueba.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//definiciones de las funciones miembro | |
Prueba::Prueba(int numero)//constructor. | |
{ | |
x = numero; | |
cout << "Se ejecuta el constructor del objeto nro: " << (*this).x << endl; | |
} | |
Prueba::~Prueba() | |
{ |
View gist:3663112848c4ac76d13ea8589e474f34
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
int main() | |
{ | |
cout << "***Entramos a main" << endl; | |
Prueba objeto(0); | |
{ | |
cout << "***Entramos al bloque" << endl; | |
Prueba objetoA(1); | |
Prueba objetoB(2); |
View herencia.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class ClaseDerivada : acceso ClaseBase | |
{ | |
//cuerpo de la nueva clase | |
} |
View main.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
using namespace std; | |
class base { | |
int i, j; | |
public: | |
void set(int a, int b) { i = a; j = b; } | |
void mostrar() { cout << i << " " << j << "\n"; } |
View polimorfismo.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include<iostream> | |
#include <math.h> | |
using namespace std; | |
class Figura { | |
private: | |
float base; | |
float altura; | |
public: | |
void captura(); |
View polimorfismo.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <string> | |
using namespace std; | |
class Mascota | |
{ | |
public: | |
Mascota(string nombre, int patas); | |
string hablar(); |
View demourp.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
using std::cout; | |
using std::endl; | |
class Increment { | |
public: | |
Increment( int c = 0, int i = 1 ); // default constructor | |
View restClient.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$client = new Zend_Http_Client(); | |
$client->setMethod(Zend_Http_Client::POST); | |
$client->setUri('http://www.example.com/api/type/'); | |
$client->setParameterPost(array( | |
'useremail' => '******@*****.***', | |
'apikey' => 'secretkey', | |
'description' => 'TEST WEB API', | |
'amount' => '5000.00' |