I am trying to print the sql values in a buffer and then try to print it. But the prbuf in the below chunk does not print anything. prbuf is defined as below:
char returnbuf[2023] = "No Info found!\n" ;
char *prbuf = &returnbuf[0] ;
case SQL_TYP_NINTEGER: /* long with null indicator */
prbuf += sprintf(prbuf, "%ld", *(long *) ptr) ;
/** this does not work **/
printf("buffer: %s\n", prbuf ) ;
lptr = (long *) ptr ;
/** this prints a value **/
printf("value: %*ld\n", maxCollen, *lptr ) ;
break ;
Am I missing anything or is there any problem with sprintf funtion.
Thanks
char returnbuf[2023] = "No Info found!\n" ;
char *prbuf = &returnbuf[0] ;
case SQL_TYP_NINTEGER: /* long with null indicator */
prbuf += sprintf(prbuf, "%ld", *(long *) ptr) ;
/** this does not work **/
printf("buffer: %s\n", prbuf ) ;
lptr = (long *) ptr ;
/** this prints a value **/
printf("value: %*ld\n", maxCollen, *lptr ) ;
break ;
Am I missing anything or is there any problem with sprintf funtion.
Thanks