69,371
社区成员
发帖
与我相关
我的任务
分享
#include<stdio.h>
#include <stdarg.h>
void print(const char *fmt)
{
va_list argp;
va_start(argp, fmt);
vfprintf(stderr, fmt, argp);
va_end(argp);
fprintf(stderr, "\n");
}
void main()
{
print("Hello world");
}
#include<stdio.h>
#include<stdlib.h>
#define black 0
#define blue 1
#define green 2
#define cyan 3
#define red 4
#define magenta 5
#define brown 6
void write_string(char *pstring,int color)
{
char *pvideo=(char *)0xB8000000;
/*Allocating memory*/
pvideo=(char *) malloc(sizeof(pstring)/sizeof(pstring[0]));
while(*pstring){
*pvideo=*pstring;
printf("%c",*pvideo);
pstring++;
*pvideo=color;
pvideo++;
}
}
void main()
{
write_string("Hello world",red);
}
char *pvideo=(char *)0xB8000000;