Search   Feed   Browse   Add
Feed items 1 - 10 of 20 for June 2008

iSeries C/C++ Technical Discussion Mailing List

Mailing list archive for c400-l at midrange.com

Re: Basic c question again - type casting - June 13, 2008

You have to do that because C provides no help with fixed-length variables. Note that C itself also provides no help with null- terminated strings. All the string functions used throughout C are library functions and part of the LANGUAGE specification. Th...
http://feeds.midrange.com/~r/c400-l/~3/311540429/msg00041.html

Re: Basic c question again - type casting - June 13, 2008

Why Is it on-line Do you have a link That's a good use of typedef even though it's weird from a C programmer's perspective. You are indicating that the interface is not a "normal" C null-terminated string but something else so pay attention. Yes it doe...
http://feeds.midrange.com/~r/c400-l/~3/311540430/msg00040.html

Re: Basic c question again - type casting - June 13, 2008

Very few people would agree with C being friendly. It has too many areas that bite unexpectedly even when keeping things simple. Classic example is: if ( a = b ) It does from a C programmer's perspective. The problem is that char implies a null-terminate...
http://feeds.midrange.com/~r/c400-l/~3/311540431/msg00039.html

Re: Basic c question again - type casting - June 13, 2008

If you're simply using typedef to provide names for char then I wouldn't bother. Your original approach of using typedef to describe fixed-length data values is better although weird from a C programmer's perspective because the language (and therefore m...
http://feeds.midrange.com/~r/c400-l/~3/311540432/msg00038.html

Re: Basic c question again - type casting - June 13, 2008

If you want your callers to pass you 10A or 2048A with trailing blanks, then the RPG prototype should say that, and be 10A. And the C typedefs should also be 10 bytes long, using your structs. But I think it would be better if you changed your procedure s...
http://feeds.midrange.com/~r/c400-l/~3/311540433/msg00037.html

Re: Basic c question again - type casting - June 13, 2008

Then your RPG prototype should be 10A, not a pointer with options(string). Your original typedefs were correct. Having char typedefs, and then secretly requiring the caller to set up blank-filled values doesn't seem very friendly. I think a better alter...
http://feeds.midrange.com/~r/c400-l/~3/311360552/msg00036.html

Re: Basic c question again - type casting - June 13, 2008

Ok, say you have this: void fn(char p); typedef char MyType; void myFn() MyType s; fn( (char ) s; Since MyType is actually char , then the cast is _currently_ correct. But what if someone changes MyType to be say one of your varying-length structs...
http://feeds.midrange.com/~r/c400-l/~3/311360553/msg00035.html

Re: Basic c question again - type casting - June 13, 2008

Then your RPG prototype should be 10A, not a pointer with options(string). Your original typedefs were correct. Having char typedefs, and then secretly requiring the caller to set up blank-filled values doesn't seem very friendly. I think a better alter...
http://feeds.midrange.com/~r/c400-l/~3/311360554/msg00034.html

Re: Basic c question again - type casting - June 13, 2008

Funny enough, I read an article yesterday that talks about c programmer should try to avoid using typedef. The reason that I use typedef is because the moduleName and locationID should actually be a fix 10 char long variables. The logMessage should actuall...
http://feeds.midrange.com/~r/c400-l/~3/311216946/msg00033.html

Re: Basic c question again - type casting - June 13, 2008

C is very user friendly. Simply keep it simple. Why cannot you write: decimal(15,0) logECD_STP3(char moduleName, char locationID, char logMessage, const int byteRcv, const char dataRcv) which is exactly the same as yours, but without all these typedef...
http://feeds.midrange.com/~r/c400-l/~3/311192052/msg00032.html
Available Archives
- June (20 items)
Sponsored Links
© 2008 FeedCapsule.com  |  Contact