在C语言中没有库函数的情况下,如何打印任何字符,字符串或变量值? [英] How will you print any character, string or value of a variable without library functions in C?

查看:331
本文介绍了在C语言中没有库函数的情况下,如何打印任何字符,字符串或变量值?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

例如,如果我不应该使用标准库函数,例如 printf() putchar(),那怎么办我可以在屏幕上打印一个字符吗?

If for example I should not use standard library functions like printf(), putchar() then how can I print a character to the screen?

有没有简单的方法可以做到这一点。我对系统调用了解不多,如果必须使用它们,该如何使用?
那么任何人都可以建议一种不使用库函数的简单打印方法吗?

Is there an easy way of doing it. I dont know much about system calls and if I have to use them then how do I use them? So can any one advice an easy way of printing without using library functions?

推荐答案

谢谢大家我在问题下方的郝先生的评论中找到了一个简单的答案。他的答案是一个简单的程序,例如

Turbo C(DOS程序):

Well thank u all for ur answers.I found one simple answer by a comment from Mr. Hao below the question. his answer is simple program like this

Turbo C(DOS program):

char far* src = (char far*) 0xB8000000L; 
*src = 'M'; 
src += 2; 
*src = 'D'; 

或尝试以下操作: http://en.wikipedia.org/wiki/Brainfuck :) – // Hao(一个小时前)

我在Turbo C上尝试过及其工作。
我想要一个简单的解决方案,我想接受它作为正确答案,但是他(郝)作为评论发表了意见,因此我将其粘贴到这里,以便其他用户代表他知道并接受。再次感谢您郝先生。

or try this: http://en.wikipedia.org/wiki/Brainfuck :) – //Hao (an hour ago)

I tried it on Turbo C and its working. I wanted a simple solution like this and I wanted to accept it as correct answer but he(Hao) gave it as a comment so I pasted it here for other users to know about this on behalf of him and accepted it. Once again thank u Mr.Hao.

这篇关于在C语言中没有库函数的情况下,如何打印任何字符,字符串或变量值?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆