Home > Back-end > Sprintf splicing char *, null pointer is identified as "(null)"
Sprintf splicing char *, null pointer is identified as "(null)"
Time:09-29
RT... For example: Char a, [10]={0}. Sprintf (a, "111% s222", b); Which is char * type b, if b=NULL, vs2010 would result in 111 (NULL) "222", I expected result is "111222", could you tell me how to solve each master... The genuflect is begged! Thank you very much!
CodePudding user response:
Finally come to a string replacement, replace is empty (null)