Thread: printf giving different values if printing in rows vs cols!

  1. #1
    Registered User
    Join Date
    Oct 2011
    Posts
    13

    printf giving different values if printing in rows vs cols!

    I don't get why I'm getting different values if I use printw in rows vs cols.

    I'm using the exact same variables, but I'm constantly getting a 0 value if I combine parameters in printw. I've combined parameters before and it never gave me an issue, but this is driving me crazy.

    printf giving different values if printing in rows vs cols!-printf_err-png

    Code:
            wprintw(vwin6,"Same Row\n");
            wprintw(vwin6,"Hard Drive Read Bytes: %u     Hard Drive Write Bytes: %u\n", statusInfo->disks->disk[i].read_bytes, statusInfo->disks->disk[i].write_bytes);
            
            wprintw(vwin6,"Same Col\n");
            wprintw(vwin6,"Hard Drive Read Bytes: %u\n", statusInfo->disks->disk[i].read_bytes);
            wprintw(vwin6,"Hard Drive Write Bytes: %u\n", statusInfo->disks->disk[i].write_bytes);

  2. #2
    Registered User
    Join Date
    Jan 2007
    Location
    Euless, TX
    Posts
    144
    First off, this is NOT a 'C' function. This is a UNIX function to be used on particular UNIX versions. So if you need help on 'wprintw' I suggest you do the following at the command prompt: man wprintw. This will give you all the assistance you need to use this print function properly in a UNIX environment.

  3. #3
    Registered User
    Join Date
    Nov 2010
    Location
    Long Beach, CA
    Posts
    5,909
    That code you posted looks fine. My only concern would be whether write_bytes is a suitable type to be passed to wprintw for a %u specifier, but I'm sure you're a good little boy/girl, and compile with warnings turned up to the max, and make sure to resolve them all properly, right?

    How about you post the smallest compilable piece of code that demonstrates the error, so we can actually help you track it down.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. output for array of pointers is not giving correct values
    By nkrao123@gmail. in forum C Programming
    Replies: 8
    Last Post: 09-03-2011, 07:40 AM
  2. printing null values with printf
    By django in forum C Programming
    Replies: 12
    Last Post: 08-23-2011, 08:24 AM
  3. what the the place for rows and cols in 2d array..
    By transgalactic2 in forum C Programming
    Replies: 3
    Last Post: 12-18-2008, 01:50 PM
  4. printing rows and columns
    By datainjector in forum C# Programming
    Replies: 1
    Last Post: 08-03-2003, 05:42 PM
  5. Replies: 0
    Last Post: 03-03-2003, 01:39 PM