📄 gets.c
字号:
#pragma option f0 /* remove page breaks */
/*
* CYC Code Development System
* Tutorial Assembly Example
* GETS.C
* This code may be adapted for any purpose
* when used with the CYC Code Development
* System. No warranty is implied or given
* as to their usability for any purpose.
*
* (c) Copyright 2000 Byte Craft Limited
* 421 King St.N., Waterloo, ON, Canada, N2J 4E4
* VOICE: 1 (519) 888 6911
* FAX : 1 (519) 746 6751
* email: support@bytecraft.com
*
* REVISION HISTORY
* v1.00 AL 01/2000 Initial Version.
*/
#include <dev\c63413.h>
#include <stdio.h>
#include <string.h>
#define getch() get_character()
#define putch(CHARACTER) put_character(CHARACTER)
const char password[] = "jiffy";
char input_string[6];
char get_character(void)
{
char ch;
ch = '\0'; /* get a character from somewhere */
return(ch);
}
void put_character(char ch)
{
PORT1=ch; /* put a character somewhere */
}
void lock(void)
{
/* lock something */
}
void unlock(void)
{
/* unlock something */
}
void main(void)
{
lock();
gets(input_string,sizeof(input_string));
if( strcmp(password,input_string) == 0 )
unlock();
while(1);
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -