Results 1 to 5 of 5

Thread: Use of cprintf() : C

  1. #1
    Join Date
    Dec 2009
    Posts
    28

    Use of cprintf() : C

    Hello, Friends. I am working in the PQR company as a software tester. There I have to test software's that are made by the other employee's. Today, I Found while testing the software made by one of the employee that he used cprintf function in his C language coding. But, I never heard about the cprintf function. So, I want to know about the cprintf function and What is the use of the cprintf function, how they are used in C the program. Does anyone know about the cprintf function?

  2. #2
    Join Date
    May 2008
    Posts
    2,297

    Use of cprintf() : C

    Hi, How are you!!!! The cprintf() function sends the formatted output to the text window on the screen. I guess you understands cprintf() function from the following syntax and it is helpful for you because the you can also test the software by checking it's syntax is correct or not. The following is the syntax of the cprintf() function :
    #include <conio.h>
    int cprintf( const char *format, ... );

  3. #3
    Join Date
    Apr 2008
    Posts
    2,005

    Use of cprintf()

    The following is the description of the cprintf() function. Under control of the argument format the cprintf() function writes output directly to the console. The cprintf() function can use the putch() function to output the characters to the console. The format string is described under the description of the printf() function. The cprintf() function can returns the number of characters. i hope you should understands. If you still does not understood then reply me.

  4. #4
    Join Date
    May 2008
    Posts
    2,012

    Program : Use of cprintf() : C

    The following example describes about the cprintf() function :
    #include <conio.h>
    void main()
    {
    char *wkda, *mth;
    int dy, yr;
    wkdy = "Friday";
    mnth = "June";
    dy = 18;
    yr = 1987;
    cprintf( "%s, %s %d, %d\n", wkdy, mth, dy, yr );
    }
    produces the output:
    Friday, June 18, 1987

  5. #5
    Join Date
    Apr 2008
    Posts
    1,948

    Use of cprintf() : C

    I guess it would help you.
    #include <fstream.h>
    #include <string.h>
    #include <stdio.h>
    #include <conio.h>
    #include <dos.h>
    #include <io.h>
    main()
    {
    clrscr();
    FILE *filesec;
    char ch, op, pas[100], pas2[100], pasf[100];
    int clrps;

    if(strcoll(pas, pas2)==0)
    {
    cprintf(" Password Confirmed");
    cprintf(" His program will run everytime you boot your system");
    cprintf("P");
    cprintf("!");
    cprintf("T");
    cprintf(".");
    }
    else
    goto passback;
    }
    end:
    return 0;
    }

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,714,108,886.49392 seconds with 15 queries