www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - Casting gremlins

reply Todd <toddtitus mindspring.com> writes:
In C it was possible to cast a Uint to a Char[], however, I can't seem to get
it to compile in D. 

example: I have 

uint data1;
long data;
long lblonedata;
.
.
.
char[] dataone = cast(char[]) data1;
lblonedata = atoi(dataone);

I'm importing std.string, std.conv;

and get e2ir: cannot cast uint to char[]

I was using dmd 1.022 and switched to 2.x today with no help.
Does D use a different method? or I'm I missing something obvious?

Todd
'newest newbee'
Oct 10 2007
parent reply Todd <toddtitus mindspring.com> writes:
Thanks Chris,

I remember trying std.conv.toString(), but I could have a hardware issue with
the Card. Will try it in the Morning.

Todd
Oct 10 2007
parent reply BCS <BCS pathlink.com> writes:
Todd wrote:
 Thanks Chris,
 
 I remember trying std.conv.toString(), but I could have a hardware issue with
the Card. Will try it in the Morning.
 
 Todd
 
Card? What type of system are you running on?
Oct 10 2007
parent reply Todd <toddtitus mindspring.com> writes:
Windows NT.
I have a PCI Card that transmit's and receives data.
Oct 10 2007
parent reply "Jarrett Billingsley" <kb3ctd2 yahoo.com> writes:
"Todd" <toddtitus mindspring.com> wrote in message 
news:fejs9l$1kr6$1 digitalmars.com...
 Windows NT.
 I have a PCI Card that transmit's and receives data.
..! It just gets mysteriouser and mysteriouser.
Oct 10 2007
parent reply Charma <Motoko_Kusanagi web.de> writes:
Jarrett Billingsley schrieb:
 "Todd" <toddtitus mindspring.com> wrote in message 
 news:fejs9l$1kr6$1 digitalmars.com...
 Windows NT.
 I have a PCI Card that transmit's and receives data.
..! It just gets mysteriouser and mysteriouser.
some people call that LAN ... uuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuh! ;)
Oct 10 2007
parent reply Todd <toddtitus mindspring.com> writes:
Nope, far from being a LAN card.
Oct 11 2007
parent reply "Jarrett Billingsley" <kb3ctd2 yahoo.com> writes:
"Todd" <toddtitus mindspring.com> wrote in message 
news:fel3i5$130n$1 digitalmars.com...
 Nope, far from being a LAN card.
Why the secrecy?
Oct 11 2007
parent reply Todd <toddtitus mindspring.com> writes:
Jarrett Billingsley Wrote:

 "Todd" <toddtitus mindspring.com> wrote in message 
 news:fel3i5$130n$1 digitalmars.com...
 Nope, far from being a LAN card.
Why the secrecy? No Secrecy, just didn't want to stray to far off topic.
It's a commercal-Industrial Arinc Transmitter Card for an Aerospace application. The toString method was working, I found that the problem is with the card itself, structure alignment or lib error. I hate hardware interfacing :)
Oct 11 2007
parent reply Bill Baxter <dnewsgroup billbaxter.com> writes:
Todd wrote:
 Jarrett Billingsley Wrote:
 
 "Todd" <toddtitus mindspring.com> wrote in message 
 news:fel3i5$130n$1 digitalmars.com...
 Nope, far from being a LAN card.
Why the secrecy? No Secrecy, just didn't want to stray to far off topic.
It's a commercal-Industrial Arinc Transmitter Card for an Aerospace application. The toString method was working, I found that the problem is with the card itself, structure alignment or lib error. I hate hardware interfacing :)
Woo hoo! D's going to space! Please tell me this is for a mission to Mars. :-) --bb
Oct 11 2007
parent Frits van Bommel <fvbommel REMwOVExCAPSs.nl> writes:
Bill Baxter wrote:
 Todd wrote:
 It's a commercal-Industrial Arinc Transmitter Card for an Aerospace 
 application.
 The toString method was working, I found that the problem is with the 
 card itself,  structure alignment or lib error. I hate hardware 
 interfacing :)
Woo hoo! D's going to space! Please tell me this is for a mission to Mars. :-) --bb
Looking at http://www.arinc.com/solutions/engineering.html it appears Arinc mostly works with the airline industry, defense etc. There's also a small section labeled "Space and Satellite Engineering" on that page but it looks like just satellites, not space missions. (i.e. nothing manned, and nothing beyond Earth orbit)
Oct 11 2007