Product Documentation
Cadence SKILL Language Reference
Product Version IC23.1, November 2023

getc

getc( 
[ p_inputPort ] 
) 
=> s_char

Description

Reads and returns a single character from an input port. Unlike the C library, the getc and getchar SKILL functions are totally unrelated.

The input port arguments for both gets and getc are optional. If the port is not given, the functions take their input from piport.

Arguments

p_inputPort

Input port; if not given, function defaults to piport.

Value Returned

s_char

Single character from the input port in symbol form. If the character returned is a non-printable character, its octal value is stored as a symbol.

Examples

In the following assume the file test1.data has its first line read as:

#This is the data for test1
p = infile("test1.data") 
=> port:"test1.data"
getc(p)
=> \#
getc(p)
=> T
getc(p)
=> h

Related Topics

gets


Return to top
 ⠀
X