helloworld.c

来自「Intro/: Directory containing introducto」· C语言 代码 · 共 39 行

C
39
字号
#include <phigs.h>			/* get HP-PHIGS definitions for C */#include <stdio.h>			/* get standard I/O definitions */main()					/* file "HelloWorld.c" */{    Pint	WorkstnID = 1;		/* workstation identifier */    Pint	ConnID;			/* connection identifier */    Pint	WorkstnType = POIDDX;	/* out/in, direct, dbl bfr, Xwindow */    Pint	StructureID = 1;	/* structure ID (chosen by user) */    Pint	ChoiceStatus, ChoiceNum;/* choice status and value */    static Ppoint3 AreaPoints[4] = {	/* points for fill area */		{0.25, 0.25, 0.0},		{0.75, 0.25, 0.0},		{0.75, 0.75, 0.0},		{0.25, 0.75, 0.0}};    static Ppoint_list3 AreaData = {4, AreaPoints};    Ppoint	TextLoc;		/* where does the text go? */    popen_phigs((char *) stderr, 0);	/* errors go to "stderr" */    pescape_u4("/dev/screen/phigs_window", &ConnID);    popen_ws(WorkstnID, (void *) ConnID, WorkstnType);    /*---- define the structure ---------------------------------------------*/    popen_struct(StructureID);    pset_int_style(PSTYLE_HOLLOW);    pfill_area3(&AreaData);    pset_char_ht(0.04);    TextLoc.x = 0.3, TextLoc.y = 0.5;    ptext(&TextLoc, "Hello World");    pclose_struct();    /*---- display the structure --------------------------------------------*/    ppost_struct(WorkstnID, StructureID, 1.0);    pupd_ws(WorkstnID, PFLAG_PERFORM);    /*pset_choice_mode(WorkstnID, 2, POP_REQ, PSWITCH_NO_ECHO);    preq_choice(WorkstnID, 2, &ChoiceStatus, &ChoiceNum);*/    pupd_ws(WorkstnID, PFLAG_PERFORM);    pclose_ws(WorkstnID);    pclose_phigs();}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?