Created
October 29, 2018 23:53
-
-
Save bhflm/9b80a57455a8d5599f31674529e0f931 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