<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="es">
	<id>http://wiki.cabal.mx/index.php?action=history&amp;feed=atom&amp;title=Curso_de_Programaci%C3%B3n_en_C%2FProg123</id>
	<title>Curso de Programación en C/Prog123 - Historial de revisiones</title>
	<link rel="self" type="application/atom+xml" href="http://wiki.cabal.mx/index.php?action=history&amp;feed=atom&amp;title=Curso_de_Programaci%C3%B3n_en_C%2FProg123"/>
	<link rel="alternate" type="text/html" href="http://wiki.cabal.mx/index.php?title=Curso_de_Programaci%C3%B3n_en_C/Prog123&amp;action=history"/>
	<updated>2026-05-13T02:16:35Z</updated>
	<subtitle>Historial de revisiones para esta página en el wiki</subtitle>
	<generator>MediaWiki 1.32.1</generator>
	<entry>
		<id>http://wiki.cabal.mx/index.php?title=Curso_de_Programaci%C3%B3n_en_C/Prog123&amp;diff=4111&amp;oldid=prev</id>
		<title>Rrc: /* Prog123 */</title>
		<link rel="alternate" type="text/html" href="http://wiki.cabal.mx/index.php?title=Curso_de_Programaci%C3%B3n_en_C/Prog123&amp;diff=4111&amp;oldid=prev"/>
		<updated>2012-10-01T12:41:33Z</updated>

		<summary type="html">&lt;p&gt;‎&lt;span dir=&quot;auto&quot;&gt;&lt;span class=&quot;autocomment&quot;&gt;Prog123&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Página nueva&lt;/b&gt;&lt;/p&gt;&lt;div&gt;__NOTOC__&lt;br /&gt;
* [[:#Prog123 | uniones]]&lt;br /&gt;
** [[:#Resultado | Resultado]]&lt;br /&gt;
** [[:#Explicación | Explicación]]&lt;br /&gt;
&lt;br /&gt;
== Prog123 ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot; line=&amp;quot;GESHI_FANCY_LINE_NUMBERS&amp;quot;&amp;gt;&lt;br /&gt;
#include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
#include &amp;lt;string.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
union Fechas {&lt;br /&gt;
  char FechaCorta[6];&lt;br /&gt;
  char FechaMediana[11];&lt;br /&gt;
  char FechaLarga[21];&lt;br /&gt;
} FechaPrueba;&lt;br /&gt;
&lt;br /&gt;
union Canasta {&lt;br /&gt;
  int    GuardaInt;&lt;br /&gt;
  double GuardaDoble;&lt;br /&gt;
  char   GuardaChar;&lt;br /&gt;
} Prueba;&lt;br /&gt;
&lt;br /&gt;
int main( void )&lt;br /&gt;
{&lt;br /&gt;
  strcpy( FechaPrueba.FechaCorta, &amp;quot;29/09&amp;quot; );&lt;br /&gt;
&lt;br /&gt;
  printf( &amp;quot;\nCon FechaPruebaFechaCorta = \&amp;quot;29/09\&amp;quot;\n&amp;quot;&lt;br /&gt;
          &amp;quot;Corta: |%s|\tMediana: |%s|\tLarga: |%s|\n&amp;quot;, FechaPrueba.FechaCorta,&lt;br /&gt;
                                                       FechaPrueba.FechaMediana,&lt;br /&gt;
                                                       FechaPrueba.FechaLarga );&lt;br /&gt;
&lt;br /&gt;
  strcpy( FechaPrueba.FechaMediana, &amp;quot;29-09-2012&amp;quot; );&lt;br /&gt;
&lt;br /&gt;
  printf( &amp;quot;\nCon FechaPruebaFechaMediana = \&amp;quot;29-09-2012\&amp;quot;\n&amp;quot;&lt;br /&gt;
          &amp;quot;Corta: |%s|\tMediana: |%s|\tLarga: |%s|\n&amp;quot;, FechaPrueba.FechaCorta,&lt;br /&gt;
                                                       FechaPrueba.FechaMediana,&lt;br /&gt;
                                                       FechaPrueba.FechaLarga );&lt;br /&gt;
&lt;br /&gt;
  strcpy( FechaPrueba.FechaLarga, &amp;quot;29/09/2012 15:25:36&amp;quot; );&lt;br /&gt;
&lt;br /&gt;
  printf( &amp;quot;\nCon FechaPruebaFechaLarga = \&amp;quot;29/09/2012 15:25:36\&amp;quot;\n&amp;quot;&lt;br /&gt;
          &amp;quot;Corta: |%s|\tMediana: |%s|\tLarga: |%s|\n&amp;quot;, FechaPrueba.FechaCorta,&lt;br /&gt;
                                                       FechaPrueba.FechaMediana,&lt;br /&gt;
                                                       FechaPrueba.FechaLarga );&lt;br /&gt;
  Prueba.GuardaInt = 123;&lt;br /&gt;
&lt;br /&gt;
  printf( &amp;quot;\nCon Prueba.GuardaInt = 123\n&amp;quot;&lt;br /&gt;
          &amp;quot;PGint: |%d|\tPGD: |%f|\tPGC: |%c|\n&amp;quot;, Prueba.GuardaInt,&lt;br /&gt;
                                                 Prueba.GuardaDoble,&lt;br /&gt;
                                                 Prueba.GuardaChar );&lt;br /&gt;
&lt;br /&gt;
  Prueba.GuardaDoble = 123.321;&lt;br /&gt;
&lt;br /&gt;
  printf( &amp;quot;\nCon Prueba.GuardaDoble = 123.321\n&amp;quot;&lt;br /&gt;
          &amp;quot;PGint: |%d|\tPGD: |%f|\tPGC: |%c|\n&amp;quot;, Prueba.GuardaInt,&lt;br /&gt;
                                                 Prueba.GuardaDoble,&lt;br /&gt;
                                                 Prueba.GuardaChar );&lt;br /&gt;
&lt;br /&gt;
  Prueba.GuardaChar = &amp;#039;R&amp;#039;;&lt;br /&gt;
&lt;br /&gt;
  printf( &amp;quot;\nCon Prueba.GuardaChar = &amp;#039;R&amp;#039;\n&amp;quot;&lt;br /&gt;
          &amp;quot;PGint: |%d|\tPGD: |%f|\tPGC: |%c|\n&amp;quot;, Prueba.GuardaInt,&lt;br /&gt;
                                                 Prueba.GuardaDoble,&lt;br /&gt;
                                                 Prueba.GuardaChar );&lt;br /&gt;
&lt;br /&gt;
  Prueba.GuardaDoble = &amp;#039;R&amp;#039;;&lt;br /&gt;
&lt;br /&gt;
  printf( &amp;quot;\nCon Prueba.GuardaDoble = &amp;#039;R&amp;#039;\n&amp;quot;&lt;br /&gt;
          &amp;quot;PGint: |%d|\tPGD: |%f|\tPGC: |%c|\n&amp;quot;, Prueba.GuardaInt,&lt;br /&gt;
                                                 Prueba.GuardaDoble,&lt;br /&gt;
                                                 Prueba.GuardaChar );&lt;br /&gt;
&lt;br /&gt;
  Prueba.GuardaInt = &amp;#039;R&amp;#039;;&lt;br /&gt;
&lt;br /&gt;
  printf( &amp;quot;\nCon Prueba.GuardaInt = &amp;#039;R&amp;#039;\n&amp;quot;&lt;br /&gt;
          &amp;quot;PGint: |%d|\tPGD: |%f|\tPGC: |%c|\n&amp;quot;, Prueba.GuardaInt,&lt;br /&gt;
                                                 Prueba.GuardaDoble,&lt;br /&gt;
                                                 Prueba.GuardaChar );&lt;br /&gt;
&lt;br /&gt;
  return 0;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Resultado ===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
[root@lclabws CClase]# gcc -Wall -o Prog123 Prog123.c&lt;br /&gt;
[root@lclabws CClase]# ./Prog123&lt;br /&gt;
&lt;br /&gt;
Con FechaPruebaFechaCorta = &amp;quot;29/09&amp;quot;&lt;br /&gt;
Corta: |29/09|	Mediana: |29/09|	Larga: |29/09|&lt;br /&gt;
&lt;br /&gt;
Con FechaPruebaFechaMediana = &amp;quot;29-09-2012&amp;quot;&lt;br /&gt;
Corta: |29-09-2012|	Mediana: |29-09-2012|	Larga: |29-09-2012|&lt;br /&gt;
&lt;br /&gt;
Con FechaPruebaFechaLarga = &amp;quot;29/09/2012 15:25:36&amp;quot;&lt;br /&gt;
Corta: |29/09/2012 15:25:36|	Mediana: |29/09/2012 15:25:36|	Larga: |29/09/2012 15:25:36|&lt;br /&gt;
&lt;br /&gt;
Con Prueba.GuardaInt = 123&lt;br /&gt;
PGint: |123|	PGD: |0.000000|	PGC: |{|&lt;br /&gt;
&lt;br /&gt;
Con Prueba.GuardaDoble = 123.321&lt;br /&gt;
PGint: |-790273982|	PGD: |123.321000|	PGC: |B|&lt;br /&gt;
&lt;br /&gt;
Con Prueba.GuardaChar = &amp;#039;R&amp;#039;&lt;br /&gt;
PGint: |-790273966|	PGD: |345.321000|	PGC: |R|&lt;br /&gt;
&lt;br /&gt;
Con Prueba.GuardaDoble = &amp;#039;R&amp;#039;&lt;br /&gt;
PGint: |0|	PGD: |82.000000|	PGC: ||&lt;br /&gt;
&lt;br /&gt;
Con Prueba.GuardaInt = &amp;#039;R&amp;#039;&lt;br /&gt;
PGint: |82|	PGD: |82.000000|	PGC: |R|&lt;br /&gt;
[root@lclabws CClase]# &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Explicación ===&lt;br /&gt;
 &lt;br /&gt;
[[Category:Programación en C]]&lt;br /&gt;
[[Category:CCabal]]&lt;br /&gt;
[[Category:CursoC]]&lt;/div&gt;</summary>
		<author><name>Rrc</name></author>
		
	</entry>
</feed>