Unix iTOps Tube

Monday, May 14, 2012

Changing value inside function

I have the following code and want to update shiftDesc inside the function. Is it correct to declare the argument as:


int shiftDesc


void prValue_vd(

  FILE*  stream,          // name of output stream

  int  shift,              // amount of shift to the right

  const char*  value,      // value associated with argument action key

  int  shiftDesc,          // additional shift to the description

  const char*  desc ) {    // description

  shiftDesc = shiftDesc + 4;

  const char*  format = "%*s\e[1;32m%s\e[0;37m%*s%s\e[0m\n";

  fprintf( stream, format, shift, " " , value, shiftDesc, " ", desc );


No comments:

Post a Comment