Created
October 29, 2018 23:52
-
-
Save bhflm/53cc7cb98b4f1b84222010be07bdf313 to your computer and use it in GitHub Desktop.
ejemplo 3
This file contains hidden or 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
pragma solidity ^0.4.25; | |
contract Ejemplo3{ | |
mapping(uint256 => Alumno) alumnos; | |
struct Alumno { | |
string nombre; | |
uint256 grupo; | |
} | |
constructor (){ | |
} | |
function agregarAlumnoAlGrupo(uint256 padron, string nombre, uint grupo){ | |
alumnos[padron].nombre = nombre; | |
alumnos[padron].grupo = grupo; | |
} | |
function agregarAlumnoAlGrupoMemory(uint256 padron, string nombre, uint grupo){ | |
Alumno memory alumnoEjemplo; | |
alumnoEjemplo.nombre = nombre; | |
alumnoEjemplo.grupo = grupo; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment