Thread: conversion control character

  1. #1
    Registered User
    Join Date
    Feb 2012
    Posts
    46

    conversion control character

    hi guys.I want to learn why the output of a printf("%c",VCV); is .C.Is there anyone to tell me that ?

  2. #2
    Registered User ledow's Avatar
    Join Date
    Dec 2011
    Posts
    435
    The line you give is totally incorrect and wouldn't compile without some extra information (and hence we have no idea what you mean). Either VCV is a variable of some kind or you mean "VCV". Either way, don't print out a string using a character printf specifier - it won't do what you expect.

    %c prints a single character.
    %s prints a whole string.

    - Compiler warnings are like "Bridge Out Ahead" warnings. DON'T just ignore them.
    - A compiler error is something SO stupid that the compiler genuinely can't carry on with its job. A compiler warning is the compiler saying "Well, that's bloody stupid but if you WANT to ignore me..." and carrying on.
    - The best debugging tool in the world is a bunch of printf()'s for everything important around the bits you think might be wrong.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Decimal to binary conversion with character string
    By jbone0881 in forum C Programming
    Replies: 3
    Last Post: 02-06-2012, 12:09 PM
  2. Character conversion
    By Dogmasur in forum C Programming
    Replies: 24
    Last Post: 09-03-2008, 06:51 AM
  3. Character type conversion error
    By xmltorrent in forum C++ Programming
    Replies: 2
    Last Post: 07-24-2006, 11:45 AM
  4. string to character conversion
    By gell10 in forum C++ Programming
    Replies: 18
    Last Post: 06-08-2004, 12:21 PM
  5. Conversion of character string to integer
    By supaben34 in forum C++ Programming
    Replies: 3
    Last Post: 10-30-2003, 04:34 AM