Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // OrtizOL - xCSw - http://ortizol.blogspot.com
- using System;
- unsafe struct UnsafeCadenaUnicode
- {
- public short Longitud;
- public fixed byte Bufer[30]; // Bloue de 30 bytes fijos.
- }
- unsafe public class Entidad
- {
- UnsafeCadenaUnicode cadena;
- public Entidad(string s)
- {
- cadena.Longitud = (short)s.Length;
- fixed (byte* puntero = cadena.Bufer)
- {
- for (int i = 0; i < s.Length; ++i)
- {
- puntero[i] = (byte) s[i];
- }
- }
- }
- }
- public class PruebaEntidad
- {
- public static void Main()
- {
- new Entidad("John Ortiz Ordoñez");
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement