Normas del foro

Curso Hacker
Bienvenido(a), Visitante. Favor de ingresar o registrarse.
¿Perdiste tu email de activación? - Noviembre 18, 2008, 01:48:25
Inicio Ayuda Ingresar Registrarse
Visita: Articulos - Juegos Gratis - Da Foros

Comunidad Underground Hispana  |  Programacion  |  Programaci贸n  |  Carbide C/C#/C++  |  Tema: problema en C++ 0 Usuarios y 1 Visitante están viendo este tema. « anterior próximo »
Páginas: [1] Ir Abajo Imprimir
Autor Tema: problema en C++  (Leído 194 veces)
anusky
Miembro
*****
Desconectado Desconectado

Mensajes: 47



Ver Perfil WWW Email
« en: Octubre 25, 2006, 12:07:40 »

hola!!! estoy empezando a hacer programas en C++ y tengo un problema a la hora de compilar esta parte:

#include<stdio.h>
#include <iostream>
#include <conio.h>
#include "matriz.h"

matriz::matriz()
{
    for (int i=0; i<M; i++)
        for (int j=0; j<M; j++)
            tabla[j]=0;
}

void matriz::mostrar()
{
for (int i=0; i<M; i++)
{
    for (int j=0; j<M; j++)
    {
        cout.width(5);
        cout<< tabla[j];
    }
    cout<< endl;
}
system("pause");
}

void matriz::cargar()
{
    for (int i=0; i<M; i++)
        for (int j=0; j<M; j++)
        {
            cout<< "m[" << i+1 <<","<< j+1 <<"] ";
            cin >> tabla[j];
        }
}

matriz matriz::operator* (matriz m)
{
    matriz n;
    for (int i=0; i<M; i++)
        for (int j=0; j<M; j++)
        {
            int prod=0;
            for (int k=0; k<M; k++)
                prod=prod+tabla[k]*m.tabla[j];
            n.tabla[j]=prod;
        }
        return n;
}

matriz matriz::operator+ (matriz m)
{
    matriz n;
    for (int i=0; i<M; i++)
        for (int j=0; j<M; j++)
        n.tabla[j]=tabla[j]+m.tabla[j];
        return n;
}

matriz matriz::operator- (matriz m)
{
    matriz n;
    for (int i=0; i<M; i++)
        for (int j=0; j<M; j++)
        n.tabla[j]=tabla[j]-m.tabla[j];
        return n;
}

matriz matriz::operator- ()
{
    matriz n;
    for (int i=0; i<M; i++)
        for (int j=0; j<M; j++)
        n.tabla[j]=-tabla[j];
        return n;
}


me sale este error en el system("pause");  :

24 matriz.cpp
 implicit declaration of function `int system(...)'


cual es el problema?Huh
En línea
anusky
Miembro
*****
Desconectado Desconectado

Mensajes: 47



Ver Perfil WWW Email
« Respuesta #1 en: Octubre 25, 2006, 12:18:49 »

vale ya nada he resuelto mi problemilla, una chorrada enorme Tongue
En línea
arvin
Visitante
« Respuesta #2 en: Octubre 25, 2006, 12:27:35 »

system("PAUSE");

This command will "pause" the screen and display the message "Press any key to continue . . . " as it waits for a keystroke. If you wish to pause the screen after a cout statement, you will need to "flush" the iostream. (Requires header file <stdlib.h>)
 
cout<< "Hello"<<endl<<flush; //flush forces the printing to the screen before it pauses
system ("PAUSE"); //pause displays a message and waits for the user to hit a key
cout<< "Good-Bye"<<endl;


also, you'll need the library, the error appear in your screen is only for the method on the class, see if your prototype is correct only...


cheers
En línea
Páginas: [1] Ir Arriba Imprimir 
Comunidad Underground Hispana  |  Programacion  |  Programaci贸n  |  Carbide C/C#/C++  |  Tema: problema en C++ « anterior próximo »
Ir a:  


Ranking-Hits
Powered by SMF 1.1.7 | SMF © 2006-2007, Simple Machines LLC