Very Basic Question

This is a discussion on Very Basic Question within the C Programming forums, part of the General Programming Boards category; I am taking a C programming course at the moment, and I am working on my first program and hit ...

  1. #1
    Registered User
    Join Date
    Feb 2003
    Posts
    1

    Question Very Basic Question

    I am taking a C programming course at the moment, and I am working on my first program and hit a minor roadblock. In the book and in my professor's examples "%d" and "%d/n" (with the quotes) are used but not explained. I know in the examples that they are not using % for a Modulus. Can anyone help me out here?

  2. #2
    Registered User
    Join Date
    Feb 2003
    Posts
    2

    Smile printf

    % tells printf and other function like it to replay the %<character> with a variable value eg printf("the variable i = %d",i);
    %d will be replaced with the value held in i. to print a character variable uses %c and to print a string %s etc any good c book will explain this in the first few pages. the \n is a carage return, like pressing return it will print what ever is after it a line below the text before it. I don't think i really explain that very well so if you want more help just email me

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. A basic math programming question
    By hebali in forum C Programming
    Replies: 38
    Last Post: 02-25-2008, 03:18 PM
  2. Basic question about GSL ODE func RK4
    By cosmich in forum Game Programming
    Replies: 1
    Last Post: 05-07-2007, 02:27 AM
  3. Basic question about RK4
    By cosmich in forum C++ Programming
    Replies: 0
    Last Post: 05-07-2007, 02:24 AM
  4. A very basic question
    By AshFooYoung in forum C Programming
    Replies: 8
    Last Post: 10-07-2001, 03:37 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21