GoHacking.com: Ethical Hacking and Cyber Security
Home » C PROGRAMMING

C Program to Print a Character without using any Output Statements

Submitted by on Sunday, 25 November 20076 Comments

This program can be used to print character without using any output statements. This program only works in 16-bit mode since it directly writes to VDU Memory.

 
 
#include<stdio.h>
#include<conio.h>
void main()
{
char far *p=(char far *)0xb8000000;
*p=’A';
getch();
}


By using/following this site you agree to our Legal Disclaimer

6 Comments »

  • Anonymous said:

    it gives an error saying

    “cannot convert unsigned long to char far*”

  • srikanth (author) said:

    try this

    char far *p=(char far*)0xb8000000;

  • Anonymous said:

    1 error C2143: syntax error : missing ‘;’ before ‘*’
    2 error C2065: ‘p’ : undeclared identifier
    3 error C2146: syntax error : missing ‘)’ before identifier ‘far’
    4 error C2059: syntax error : ‘)’
    5 error C2065: ‘p’ : undeclared identifier

    these are the 5 errors I’m gettin.

  • Srikanth (author) said:

    First of all this program is compiler dependent can only be compiled by 16-bit compiler under windows.So if you are using Linux or modern compilers such as VC++ or 32-bit C++ compilers the program does not work.32-bit compilers do not have the concept of near,far huge pointers..

    So this my be the cause for errors in your case

  • Sam said:

    Cool dude………

  • sunil said:

    wat does Oxb8000000 do….

Leave your response!

Add your comment below, or trackback from your own site. You can also subscribe to these comments via RSS.

Be nice. Keep it clean. Stay on topic. No spam.

You can use these tags:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

This is a Gravatar-enabled weblog. To get your own globally-recognized-avatar, please register at Gravatar.