O. xml

Source: Internet
Author: User
Pre {border-style: solid; border-width: 1px; border-color: #000; line-Height: 1; color: #800016; font-size: 16px ;}. sysfunc {color: #566d68; font-style: italic; font-weight: bold ;}. selffuc {color: # f3e191 ;}. bool {color: # f6ac77 ;}. condition {color: # ff00ff; font-weight: bold ;}. key {color: # c1018f ;}. vaR {color: # 4e00ff; font-style: italic ;}. digit {color: #000080; font-weight: bold ;}. includepre {color: #160080 ;}. operator? {Color: #008000; font-weight: bold ;}

Function Name :? Open?

?? Yes :? Open a file for reading or writing?

Use ?? Method :? Int? Open (Char? * Pathname ,? Int? Access [,? Int? Permiss]);?

Program example :?

  
   #include?<string.h>?#include?<stdio.h>?#include?<fcntl.h>?#include?<io.h>?int?main(void)?{????int?handle;????char?msg[]?=?"Hello?world";????if?((handle?=?open("TEST.$$$",?O_CREAT?|?O_TEXT))?==?-1)????{???????perror("Error:");???????return?1;????}????write(handle,?msg,?strlen(msg));????close(handle);????return?0;?}?????
   
  

Function Name :? Outport?

?? Yes :? Output an integer to the hardware port?

Use ?? Method :? Void? Outport (Int? Port ,? Int? Value );?

Program example :?

  
   #include?<stdio.h>?#include?<dos.h>?int?main(void)?{????int?value?=?64;????int?port?=?0;????outportb(port,?value);????printf("Value?%d?sent?to?port?number?%d\n",?value,?port);????return?0;?}?????
   
  

Function Name :? Outportb?

?? Yes :? Output bytes to hardware port?

Use ?? Method :? Void? Outportb (Int? Port ,? Char? Byte );?

Program example :?

  
   #include?<stdio.h>?#include?<dos.h>?int?main(void)?{????int?value?=?64;????int?port?=?0;????outportb(port,?value);????printf("Value?%d?sent?to?port?number?%d\n",?value,?port);????return?0;?}?????
   
  

Function Name :? Outtext?

?? Yes :? Is a string displayed in the view area?

Use ?? Method :? Void? Far? Outtext (Char? Far? * Textstring );?

Program example :?

  
   #include?<graphics.h>?#include?<stdlib.h>?#include?<stdio.h>?#include?<conio.h>?int?main(void)?{????/*?request?auto?detection?*/????int?gdriver?=?DETECT,?gmode,?errorcode;????int?midx,?midy;????/*?initialize?graphics?and?local?variables?*/????initgraph(&gdriver,?&gmode,?"");????/*?read?result?of?initialization?*/????errorcode?=?graphresult();????if?(errorcode?!=?grOk)??/*?an?error?occurred?*/????{???????printf("Graphics?error:?%s\n",?grapherrormsg(errorcode));???????printf("Press?any?key?to?halt:");???????getch();???????exit(1);?/*?terminate?with?an?error?code?*/????}????midx?=?getmaxx()?/?2;????midy?=?getmaxy()?/?2;????/*?move?the?C.P.?to?the?center?of?the?screen?*/????moveto(midx,?midy);????/*?output?text?starting?at?the?C.P.?*/????outtext("This?");????outtext("is?");????outtext("a?");????outtext("test.");????/*?clean?up?*/????getch();????closegraph();????return?0;?}?????
   
  

Function Name :? Outtextxy?

?? Yes :? Is a string displayed at a specified position?

Use ?? Method :? Void? Far? Outtextxy (Int? X ,? Int? Y ,? Char? * Textstring );?

Program example :?

  
   #include?<graphics.h>?#include?<stdlib.h>?#include?<stdio.h>?#include?<conio.h>?int?main(void)?{????/*?request?auto?detection?*/????int?gdriver?=?DETECT,?gmode,?errorcode;????int?midx,?midy;????/*?initialize?graphics?and?local?variables?*/????initgraph(?&gdriver,?&gmode,?"");????/*?read?result?of?initialization?*/????errorcode?=?graphresult();????if?(errorcode?!=?grOk)??/*?an?error?occurred?*/????{???????printf("Graphics?error:?%s\n",?grapherrormsg(errorcode));???????printf("Press?any?key?to?halt:");???????getch();???????exit(1);?/*?terminate?with?an?error?code?*/????}????midx?=?getmaxx()?/?2;????midy?=?getmaxy()?/?2;????/*?output?text?at?the?center?of?the?screen*/????/*?Note:?the?C.P.?doesn‘t?get?changed.*/????outtextxy(midx,?midy,?"This?is?a?test.");????/*?clean?up?*/????getch();????closegraph();????return?0;?}??????????
   
  

Used in this article? Calligraphy and painting novel software? Released, the content has nothing to do with the software, and the painting and calligraphy novel software? More comfortable reading, more comfortable writing, and easier Publishing.

O. xml

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.