cplsplsprogrammer
Programmer
Hello All, I am working with strings and got this problem. I have a pointer string which is populated by MQ series library function. I am trying to call function B from function A and trying to pass this message pointer string. When I see the pointer string in debug mode in function A i have the whole message but when I see the pointer string after passing to function B it is having only the first four characters before the null ('\0') occured the rest of the string is being chopped off. Can anyone please tell me what is happening.... how different are character array in C and String in .Net? I thought because of the null character the compiler is thinking that is the end of the string but my decleartion is pointer of strings, should it not take all the string? Please throw some light on strings in .Net.
function A( )
{
String* Msg;
// Send this pointer string to MQ series and I get a Message populated in the string.
// the message is like --- abcd'\0' efg '\0' '\0' klmnopqrws......................................... xyz
functionB( Msg );
}
function B( String* Msg )
{
//operation on that message
}
Thanks....
Ram
function A( )
{
String* Msg;
// Send this pointer string to MQ series and I get a Message populated in the string.
// the message is like --- abcd'\0' efg '\0' '\0' klmnopqrws......................................... xyz
functionB( Msg );
}
function B( String* Msg )
{
//operation on that message
}
Thanks....
Ram