www.digitalmars.com         C & C++   DMDScript  

c++ - Compound Literals

reply Pedro Izecksohn <izecksohn yahoo.com> writes:
#include <stdio.h>

typedef struct
{
  int a;
  int b;
} two_integers;

int main ()
{
  two_integers ti = {0, 0};
  printf ("ti.a = %d\tti.b = %d\n", ti.a, ti.b);
  ti = (two_integers) {1, 2};
  printf ("ti.a = %d\tti.b = %d\n", ti.a, ti.b);
  return 0;
}
Nov 15 2009
parent reply "Matthew Wilson" <matthew hat.stlsoft.dot.org> writes:
What's your question? (Or are you assuming we've enough spare time to work out
your question _and_ your answer?)

"Pedro Izecksohn" <izecksohn yahoo.com> wrote in message
news:hdp9h3$ptq$1 digitalmars.com...
 #include <stdio.h>

 typedef struct
 {
   int a;
   int b;
 } two_integers;

 int main ()
 {
   two_integers ti = {0, 0};
   printf ("ti.a = %d\tti.b = %d\n", ti.a, ti.b);
   ti = (two_integers) {1, 2};
   printf ("ti.a = %d\tti.b = %d\n", ti.a, ti.b);
   return 0;
 }

Nov 20 2009
parent Pedro Izecksohn <izecksohn yahoo.com> writes:
Does Digital Mars plan to implement the compilation of compound literals by dmc?
Nov 20 2009