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

 

 


Tema destacado: Estamos en la red social de Mastodon


+  Foro de elhacker.net
|-+  Programación
| |-+  Programación General
| | |-+  Java
| | | |-+  Ayuda con un codigo
0 Usuarios y 1 Visitante están viendo este tema.
Páginas: [1] Ir Abajo Respuesta Imprimir
Autor Tema: Ayuda con un codigo  (Leído 1,821 veces)
Th3Craze2

Desconectado Desconectado

Mensajes: 2



Ver Perfil
Ayuda con un codigo
« en: 28 Febrero 2017, 00:18 am »

Hola buen día, necesito una ayudita con este codigo, apenas me estoy iniciando en esto de las interfaces graficas con java. La cosa es que necesito almecenar varios datos en una pila,estos datos los estoy capturando desde los jtextfield, ya he hecho el progrma en consola y funciona sin problemas, pero aca no me guarda los valores me los asigna como nulo luego de salir del metodo insertar en la clase registro, porque si pongo un mensaje por consola del metodo insertar del contruct me asigna los valores y al mismo tiempo pongo un JOptionPane en la clase registro justo despues de la llamada al metodo y me da los valores nulos pero en consola me muestra los valores, realmente no entiendo xD.

aca les dejo partes del codigo.

Clase pila. donde se  deben apilar los datos.
Código
  1. package pila;
  2. /**
  3.  *
  4.  * @author Th3Crze2
  5.  */
  6. public class pila {
  7.    private pila siguiente;
  8.    private String nombre;
  9.    private String apellido;
  10.    /**
  11.      * @return the siguiente
  12.      */
  13.    public pila getSiguiente() {
  14.        return siguiente;
  15.    }
  16.    /**
  17.      * @param siguiente the siguiente to set
  18.      */
  19.    public void setSiguiente(pila siguiente) {
  20.        this.siguiente = siguiente;
  21.    }
  22.    /**
  23.      * @return the nombre
  24.      */
  25.    public String getNombre() {
  26.        return nombre;
  27.    }
  28.    /**
  29.      * @param nombre the nombre to set
  30.      */
  31.    public void setNombre(String nombre) {
  32.        this.nombre = nombre;
  33.    }
  34.  
  35.    /**
  36.      * @return the apellido
  37.      */
  38.    public String getApellido() {
  39.        return apellido;
  40.    }
  41.  
  42.    /**
  43.      * @param apellido the apellido to set
  44.      */
  45.    public void setApellido(String apellido) {
  46.        this.apellido = apellido;
  47.    }
  48. }
  49.  

Clase Contruct el motodo insertar.

Código
  1. package pila;
  2. public class contruct {
  3.     pila cima;
  4.    int tamanio;
  5.    public contruct(){
  6.        cima=null;
  7.        tamanio=0;
  8.    }
  9.    public boolean pilaVacia(){
  10.        return cima==null;
  11.    }
  12.    //PUSH
  13.    public void insertar(String non, String ape){
  14.        pila nuevo=new pila();
  15.        nuevo.setNombre(non);
  16.        nuevo.setApellido(ape);
  17.        nuevo.setSiguiente(cima);
  18.        cima=nuevo;
  19.        tamanio++;
  20.    }
  21.    //POP
  22.  
  23. }
  24.    }

Clase registro donde esta la Interfaz de registrar. el codigo lo estoy metiendo en el boton registrar(jButton1).

Código
  1. package pila;
  2. import java.awt.Color;
  3. import javax.swing.JOptionPane;
  4. import javax.swing.border.LineBorder;
  5. /**
  6.  *
  7.  * @author Th3Crze2
  8.  */
  9. public class registro extends javax.swing.JFrame {
  10.    public registro() {
  11.        initComponents();
  12.  
  13.    }
  14.    @SuppressWarnings("unchecked")
  15.    // <editor-fold defaultstate="collapsed" desc="Generated Code">                          
  16.    private void initComponents() {
  17.  
  18.        jLabel1 = new javax.swing.JLabel();
  19.        textNombre = new javax.swing.JTextField();
  20.        jLabel2 = new javax.swing.JLabel();
  21.        jSeparator1 = new javax.swing.JSeparator();
  22.        jLabel3 = new javax.swing.JLabel();
  23.        textApellido = new javax.swing.JTextField();
  24.        jButton1 = new javax.swing.JButton();
  25.        jButton2 = new javax.swing.JButton();
  26.        jLabel4 = new javax.swing.JLabel();
  27.        jLabel5 = new javax.swing.JLabel();
  28.  
  29.        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
  30.  
  31.        jLabel1.setText("Nombre:");
  32.  
  33.        textNombre.addMouseListener(new java.awt.event.MouseAdapter() {
  34.            public void mouseClicked(java.awt.event.MouseEvent evt) {
  35.                textNombreMouseClicked(evt);
  36.            }
  37.            public void mouseExited(java.awt.event.MouseEvent evt) {
  38.                textNombreMouseExited(evt);
  39.            }
  40.        });
  41.        textNombre.addActionListener(new java.awt.event.ActionListener() {
  42.            public void actionPerformed(java.awt.event.ActionEvent evt) {
  43.                textNombreActionPerformed(evt);
  44.            }
  45.        });
  46.        textNombre.addKeyListener(new java.awt.event.KeyAdapter() {
  47.            public void keyTyped(java.awt.event.KeyEvent evt) {
  48.                textNombreKeyTyped(evt);
  49.            }
  50.        });
  51.  
  52.        jLabel2.setText("REGISTRO DE ESTUDIANTES");
  53.  
  54.        jLabel3.setText("Apellido");
  55.  
  56.        jButton1.setText("REGISTRAR");
  57.        jButton1.addActionListener(new java.awt.event.ActionListener() {
  58.            public void actionPerformed(java.awt.event.ActionEvent evt) {
  59.                jButton1ActionPerformed(evt);
  60.            }
  61.        });
  62.  
  63.        jButton2.setText("VOLVER");
  64.        jButton2.addActionListener(new java.awt.event.ActionListener() {
  65.            public void actionPerformed(java.awt.event.ActionEvent evt) {
  66.                jButton2ActionPerformed(evt);
  67.            }
  68.        });
  69.  
  70.        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
  71.        getContentPane().setLayout(layout);
  72.        layout.setHorizontalGroup(
  73.            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
  74.            .addGroup(layout.createSequentialGroup()
  75.                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
  76.                    .addGroup(layout.createSequentialGroup()
  77.                        .addGap(81, 81, 81)
  78.                        .addComponent(jLabel2))
  79.                    .addGroup(layout.createSequentialGroup()
  80.                        .addGap(32, 32, 32)
  81.                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
  82.                            .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
  83.                                .addGroup(layout.createSequentialGroup()
  84.                                    .addComponent(jButton1)
  85.                                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
  86.                                    .addComponent(jButton2))
  87.                                .addGroup(layout.createSequentialGroup()
  88.                                    .addComponent(jLabel1)
  89.                                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
  90.                                    .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
  91.                                        .addComponent(jLabel5, javax.swing.GroupLayout.PREFERRED_SIZE, 48, javax.swing.GroupLayout.PREFERRED_SIZE)
  92.                                        .addGroup(layout.createSequentialGroup()
  93.                                            .addGap(13, 13, 13)
  94.                                            .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
  95.                                                .addComponent(jLabel4, javax.swing.GroupLayout.PREFERRED_SIZE, 167, javax.swing.GroupLayout.PREFERRED_SIZE)
  96.                                                .addComponent(textNombre, javax.swing.GroupLayout.PREFERRED_SIZE, 177, javax.swing.GroupLayout.PREFERRED_SIZE)
  97.                                                .addComponent(textApellido, javax.swing.GroupLayout.PREFERRED_SIZE, 177, javax.swing.GroupLayout.PREFERRED_SIZE))))))
  98.                            .addComponent(jLabel3))))
  99.                .addContainerGap(47, Short.MAX_VALUE))
  100.            .addComponent(jSeparator1, javax.swing.GroupLayout.Alignment.TRAILING)
  101.        );
  102.        layout.setVerticalGroup(
  103.            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
  104.            .addGroup(layout.createSequentialGroup()
  105.                .addGap(9, 9, 9)
  106.                .addComponent(jLabel2)
  107.                .addGap(3, 3, 3)
  108.                .addComponent(jSeparator1, javax.swing.GroupLayout.PREFERRED_SIZE, 10, javax.swing.GroupLayout.PREFERRED_SIZE)
  109.                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
  110.                .addComponent(jLabel5)
  111.                .addGap(12, 12, 12)
  112.                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
  113.                    .addComponent(jLabel1)
  114.                    .addComponent(textNombre, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
  115.                .addGap(12, 12, 12)
  116.                .addComponent(jLabel4)
  117.                .addGap(30, 30, 30)
  118.                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
  119.                    .addComponent(jLabel3)
  120.                    .addComponent(textApellido, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
  121.                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 183, Short.MAX_VALUE)
  122.                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
  123.                    .addComponent(jButton1)
  124.                    .addComponent(jButton2))
  125.                .addGap(25, 25, 25))
  126.        );
  127.  
  128.        pack();
  129.    }// </editor-fold>                        
  130.  
  131.    private void textNombreActionPerformed(java.awt.event.ActionEvent evt) {                                          
  132.      // TODO add your handling code here:
  133.    }                                          
  134.  
  135.    private void textNombreMouseClicked(java.awt.event.MouseEvent evt) {                                        
  136.  
  137. textNombre.setBorder(new LineBorder(Color.red));// TODO add your handling code here:
  138.    }                                      
  139.  
  140.    private void textNombreMouseExited(java.awt.event.MouseEvent evt) {                                      
  141.  
  142.  
  143.    }                                      
  144.  
  145.    private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {                                        
  146. principal p=new principal();
  147. p.setVisible(true);// TODO add your handling code here:
  148. this.setVisible(false);
  149.  
  150.    }                                        
  151.  
  152.    private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {                                        
  153.    contruct cc=new contruct();
  154.    pila p=new pila();
  155.    String tnon;
  156.    String tape;
  157.    if("".equals(textNombre.getText())|| "".equals(textApellido.getText())){
  158.        JOptionPane.showMessageDialog(null, "Campos requeridos", "ERROR", JOptionPane.ERROR_MESSAGE);
  159.    }else{
  160.       tnon=textNombre.getText();
  161.       tape=textApellido.getText();
  162.       cc.insertar(tnon, tape);
  163.       JOptionPane.showMessageDialog(null, "Registro Completado", "CORRECTO", JOptionPane.PLAIN_MESSAGE);
  164.    }
  165.    textNombre.setText("");
  166.    textApellido.setText("");
  167.    }                                        
  168.  
  169.    private void textNombreKeyTyped(java.awt.event.KeyEvent evt) {                                    
  170. char c=evt.getKeyChar();
  171.          if(Character.isDigit(c)) {
  172.              getToolkit().beep();
  173.  
  174.              evt.consume();
  175.          }         // TODO add your handling code here:
  176.    }                                  
  177.  
  178.    /**
  179.      * @param args the command line arguments
  180.      */
  181.    public static void main(String args[]) {
  182.        /* Set the Nimbus look and feel */
  183.        //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
  184.        /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
  185.          * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html
  186.          */
  187.        try {
  188.            for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
  189.                if ("Nimbus".equals(info.getName())) {
  190.                    javax.swing.UIManager.setLookAndFeel(info.getClassName());
  191.                    break;
  192.                }
  193.            }
  194.        } catch (ClassNotFoundException ex) {
  195.            java.util.logging.Logger.getLogger(registro.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
  196.        } catch (InstantiationException ex) {
  197.            java.util.logging.Logger.getLogger(registro.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
  198.        } catch (IllegalAccessException ex) {
  199.            java.util.logging.Logger.getLogger(registro.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
  200.        } catch (javax.swing.UnsupportedLookAndFeelException ex) {
  201.            java.util.logging.Logger.getLogger(registro.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
  202.        }
  203.        //</editor-fold>
  204.  
  205.        /* Create and display the form */
  206.        java.awt.EventQueue.invokeLater(new Runnable() {
  207.            public void run() {
  208.                new registro().setVisible(true);
  209.            }
  210.        });
  211.    }
  212.  
  213.    // Variables declaration - do not modify                    
  214.    private javax.swing.JButton jButton1;
  215.    private javax.swing.JButton jButton2;
  216.    private javax.swing.JLabel jLabel1;
  217.    private javax.swing.JLabel jLabel2;
  218.    private javax.swing.JLabel jLabel3;
  219.    private javax.swing.JLabel jLabel4;
  220.    private javax.swing.JLabel jLabel5;
  221.    private javax.swing.JSeparator jSeparator1;
  222.    private javax.swing.JTextField textApellido;
  223.    private javax.swing.JTextField textNombre;
  224.    // End of variables declaration                  
  225. }
  226.  

Y la clase principal donde estar la interfaz pricipal con todas las opciones, aun no tiene nada importante , pero de todas maneras hay va

Código
  1. package pila;
  2. import com.sun.glass.ui.Application;
  3. import javax.swing.JOptionPane;
  4. /**
  5.  *
  6.  * @author Th3Crze2
  7.  */
  8. public class principal extends javax.swing.JFrame {
  9. contruct co=new contruct();
  10. pila pila=new pila();
  11.  
  12.  
  13.    /**
  14.      * Creates new form principal
  15.      */
  16.    public principal() {
  17.        initComponents();
  18.  
  19.    }
  20.  
  21.    @SuppressWarnings("unchecked")
  22.    // <editor-fold defaultstate="collapsed" desc="Generated Code">                          
  23.    private void initComponents() {
  24.  
  25.        jInternalFrame1 = new javax.swing.JInternalFrame();
  26.        jPopupMenu1 = new javax.swing.JPopupMenu();
  27.        jButton1 = new javax.swing.JButton();
  28.        jButton2 = new javax.swing.JButton();
  29.        jButton3 = new javax.swing.JButton();
  30.        jButton4 = new javax.swing.JButton();
  31.        jButton5 = new javax.swing.JButton();
  32.        jButton6 = new javax.swing.JButton();
  33.  
  34.        jInternalFrame1.setVisible(true);
  35.  
  36.        javax.swing.GroupLayout jInternalFrame1Layout = new javax.swing.GroupLayout(jInternalFrame1.getContentPane());
  37.        jInternalFrame1.getContentPane().setLayout(jInternalFrame1Layout);
  38.        jInternalFrame1Layout.setHorizontalGroup(
  39.            jInternalFrame1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
  40.            .addGap(0, 0, Short.MAX_VALUE)
  41.        );
  42.        jInternalFrame1Layout.setVerticalGroup(
  43.            jInternalFrame1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
  44.            .addGap(0, 0, Short.MAX_VALUE)
  45.        );
  46.  
  47.        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
  48.        setCursor(new java.awt.Cursor(java.awt.Cursor.DEFAULT_CURSOR));
  49.  
  50.        jButton1.setText("Ingresar Estudiante");
  51.        jButton1.addActionListener(new java.awt.event.ActionListener() {
  52.            public void actionPerformed(java.awt.event.ActionEvent evt) {
  53.                jButton1ActionPerformed(evt);
  54.            }
  55.        });
  56.  
  57.        jButton2.setText("Sacar Estudiante");
  58.  
  59.        jButton3.setText("Mostrar Estudiantes");
  60.  
  61.        jButton4.setText("Cima de la Pila");
  62.        jButton4.addActionListener(new java.awt.event.ActionListener() {
  63.            public void actionPerformed(java.awt.event.ActionEvent evt) {
  64.                jButton4ActionPerformed(evt);
  65.            }
  66.        });
  67.  
  68.        jButton5.setText("Finalizar Aplicación");
  69.        jButton5.addActionListener(new java.awt.event.ActionListener() {
  70.            public void actionPerformed(java.awt.event.ActionEvent evt) {
  71.                jButton5ActionPerformed(evt);
  72.            }
  73.        });
  74.  
  75.        jButton6.setText("Tamaño de la pila");
  76.        jButton6.addActionListener(new java.awt.event.ActionListener() {
  77.            public void actionPerformed(java.awt.event.ActionEvent evt) {
  78.                jButton6ActionPerformed(evt);
  79.            }
  80.        });
  81.  
  82.        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
  83.        getContentPane().setLayout(layout);
  84.        layout.setHorizontalGroup(
  85.            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
  86.            .addGroup(layout.createSequentialGroup()
  87.                .addGap(72, 72, 72)
  88.                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
  89.                    .addComponent(jButton6, javax.swing.GroupLayout.PREFERRED_SIZE, 212, javax.swing.GroupLayout.PREFERRED_SIZE)
  90.                    .addComponent(jButton5, javax.swing.GroupLayout.PREFERRED_SIZE, 212, javax.swing.GroupLayout.PREFERRED_SIZE)
  91.                    .addComponent(jButton4, javax.swing.GroupLayout.PREFERRED_SIZE, 212, javax.swing.GroupLayout.PREFERRED_SIZE)
  92.                    .addComponent(jButton3, javax.swing.GroupLayout.PREFERRED_SIZE, 212, javax.swing.GroupLayout.PREFERRED_SIZE)
  93.                    .addComponent(jButton2, javax.swing.GroupLayout.PREFERRED_SIZE, 212, javax.swing.GroupLayout.PREFERRED_SIZE)
  94.                    .addComponent(jButton1, javax.swing.GroupLayout.PREFERRED_SIZE, 212, javax.swing.GroupLayout.PREFERRED_SIZE))
  95.                .addContainerGap(76, Short.MAX_VALUE))
  96.        );
  97.        layout.setVerticalGroup(
  98.            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
  99.            .addGroup(layout.createSequentialGroup()
  100.                .addGap(35, 35, 35)
  101.                .addComponent(jButton1)
  102.                .addGap(33, 33, 33)
  103.                .addComponent(jButton2)
  104.                .addGap(33, 33, 33)
  105.                .addComponent(jButton3)
  106.                .addGap(36, 36, 36)
  107.                .addComponent(jButton4)
  108.                .addGap(34, 34, 34)
  109.                .addComponent(jButton6)
  110.                .addGap(35, 35, 35)
  111.                .addComponent(jButton5)
  112.                .addContainerGap(34, Short.MAX_VALUE))
  113.        );
  114.  
  115.        pack();
  116.    }// </editor-fold>                        
  117.  
  118.    private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {                                        
  119. registro r = new registro();
  120. r.setVisible(true);
  121.  
  122. this.setVisible(false);
  123.  
  124.              // TODO add your handling code here:
  125.    }                                        
  126.  
  127.    private void jButton5ActionPerformed(java.awt.event.ActionEvent evt) {                                        
  128.    dispose();        // TODO add your handling code here:
  129.    }                                        
  130.  
  131.    private void jButton4ActionPerformed(java.awt.event.ActionEvent evt) {                                        
  132.  
  133.    }                                        
  134.  
  135.    private void jButton6ActionPerformed(java.awt.event.ActionEvent evt) {                                        
  136.  
  137.    }                                        
  138.  
  139.    /**
  140.      * @param args the command line arguments
  141.      */
  142.    public static void main(String args[]) {
  143.        /* Set the Nimbus look and feel */
  144.        //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
  145.        /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
  146.          * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html
  147.          */
  148.        try {
  149.            for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
  150.                if ("Nimbus".equals(info.getName())) {
  151.                    javax.swing.UIManager.setLookAndFeel(info.getClassName());
  152.                    break;
  153.                }
  154.            }
  155.        } catch (ClassNotFoundException ex) {
  156.            java.util.logging.Logger.getLogger(principal.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
  157.        } catch (InstantiationException ex) {
  158.            java.util.logging.Logger.getLogger(principal.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
  159.        } catch (IllegalAccessException ex) {
  160.            java.util.logging.Logger.getLogger(principal.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
  161.        } catch (javax.swing.UnsupportedLookAndFeelException ex) {
  162.            java.util.logging.Logger.getLogger(principal.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
  163.        }
  164.        //</editor-fold>
  165.  
  166.        /* Create and display the form */
  167.        java.awt.EventQueue.invokeLater(new Runnable() {
  168.            public void run() {
  169.                new principal().setVisible(true);
  170.            }
  171.        });
  172.    }
  173.  
  174.    // Variables declaration - do not modify                    
  175.    private javax.swing.JButton jButton1;
  176.    private javax.swing.JButton jButton2;
  177.    private javax.swing.JButton jButton3;
  178.    private javax.swing.JButton jButton4;
  179.    private javax.swing.JButton jButton5;
  180.    private javax.swing.JButton jButton6;
  181.    private javax.swing.JInternalFrame jInternalFrame1;
  182.    private javax.swing.JPopupMenu jPopupMenu1;
  183.    // End of variables declaration                  
  184. }

sinceramente no logro ver que hago mal, gracias de antemano y disculpas si publique esto donde no debia.


En línea

El conocimiento es la mejor inverción
6hiii

Desconectado Desconectado

Mensajes: 8


Ver Perfil
Re: Ayuda con un codigo
« Respuesta #1 en: 15 Marzo 2017, 03:13 am »

Deberías mostrar como SI te imprimen los valores en consola, así es mas fácil. Aparte de esto, lo que es seguro es que tienes un problema de referencias.

Un Saludo.


En línea

Th3Craze2

Desconectado Desconectado

Mensajes: 2



Ver Perfil
Re: Ayuda con un codigo
« Respuesta #2 en: 22 Marzo 2017, 01:48 am »

si, hola el problema lo corregi hace mucho y si, se trata de la referencia que hacia ala pila lo hacia de modo local en cada metodo y tenia que declarar era una global para todos.
En línea

El conocimiento es la mejor inverción
Páginas: [1] Ir Arriba Respuesta Imprimir 

Ir a:  

Mensajes similares
Asunto Iniciado por Respuestas Vistas Último mensaje
Ayuda con codigo en C (no me ejecuta un for y necesito ayuda) « 1 2 3 »
Programación C/C++
Søra 22 11,491 Último mensaje 22 Mayo 2010, 00:22 am
por Littlehorse
¿Cuál es la diferencia entre código objeto, código máquina y código binario?
Programación General
Aikanáro Anário 9 28,885 Último mensaje 23 Diciembre 2010, 15:19 pm
por pucheto
ayuda codigo
Programación C/C++
kunai 3 2,480 Último mensaje 1 Junio 2011, 12:56 pm
por Akai
ayuda!! necesito ayuda con este pequeño codigo en c++
Programación C/C++
giraffe 1 4,674 Último mensaje 27 Mayo 2015, 06:25 am
por engel lex
Ayuda con codigo
Programación C/C++
jogugago 2 2,539 Último mensaje 22 Marzo 2021, 23:58 pm
por MAFUS
WAP2 - Aviso Legal - Powered by SMF 1.1.21 | SMF © 2006-2008, Simple Machines