Sponsored Content
Full Discussion: getch & getche not in ubuntu
Top Forums Programming getch & getche not in ubuntu Post 302429153 by Praveen_218 on Sunday 13th of June 2010 07:12:38 AM
Old 06-13-2010
The version of getch() ...

Which you may want to use under Linux is declered as (under stdio.h header)
Code:
extern int getchar (void);

and defined with the '/usr/lib/libc.a' which is the stdio library.

I guess, you are looking for this one and the same is available as getch(), under windows (probably TC?) and described in 'Let us C' because they have tested their program under windows C compiler only.

Apart getc() is same as getchar(stdin) under the same library, I mentioned above.

Code:
extern int getc (FILE *__stream);

I could, however, see the libncurses.so in your systems output.

Last edited by Praveen_218; 06-14-2010 at 12:49 AM..
 

7 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Would like to install x86 desktop Ubuntu over AMD64 Ubuntu server

My intention was to build a dual boot XP Pro 64 and Ubuntu media server. I had installed the AMD64 version of Ubuntu 8.10 server and thought that I would be able to install Apache server. I need a GUI to work in. I tried to boot and install Mythbuntu 32 bit 8.10, but my machine now won't recognize... (0 Replies)
Discussion started by: docflyboy
0 Replies

2. Shell Programming and Scripting

PHP read large string & split in multidimensional arrays & assign fieldnames & write into MYSQL

Hi, I hope the title does not scare people to look into this thread but it describes roughly what I'm trying to do. I need a solution in PHP. I'm a programming beginner, so it might be that the approach to solve this, might be easier to solve with an other approach of someone else, so if you... (0 Replies)
Discussion started by: lowmaster
0 Replies

3. Ubuntu

Ubuntu / Ubuntu File Manager / Config

I am using Ubuntu 9.10 with Gnome 2.28. I use the default Nautilus File Manager to view / manage files. Is there a way to add icons or customize the icons that are above the location bar and below the menus? There is a bar that has icons for "Back" "Forward" "Parent" above the location bar. I... (6 Replies)
Discussion started by: drewk
6 Replies

4. Shell Programming and Scripting

replace & with & xml file

Hello All I have a xml file with many sets of records like this <mytag>mydata</mytag> <tag2>data&</tag2> also same file can be like this <mytag>mydata</mytag> <tag2>data&</tag2> <tag3>data2&amp;data3</tag3> Now i can grep & and replace with &amp; for whole file but it will replace all... (4 Replies)
Discussion started by: lokaish23
4 Replies

5. Ubuntu

[UBUNTU] mount.nfs fails in Ubuntu / Works on Red Hat!!!

Gurus, I want log in locally to my Lucid (10.04) workstation and have my code saved over the network on my samba account At work, all developers have samba user ids and when we were running Red Hat, we went thru the following procedure to get setup. * open a shell session to NFS server... (2 Replies)
Discussion started by: alan
2 Replies

6. Shell Programming and Scripting

Replace & sign to &amp word

Hi, I have text file abc.txt. In this file, I have the following data. Input: Mr Smith &amp Mrs Smith Mr Smith &apos Mrs Smith Mr Smith & Mrs Smith Mr Smith& Mrs Smith Mr Smith &Mrs Smith Output: Mr Smith &amp Mrs Smith Mr Smith &apos Mrs Smith Mr Smith &amp Mrs Smith Mr Smith&amp... (4 Replies)
Discussion started by: naveed
4 Replies

7. Shell Programming and Scripting

SFTP Shell Script Get & Delete && Upload & Delete

Hi All, Do you have any sample script, - auto get file from SFTP remote server and delete file in remove server after downloaded. - only download specify filename - auto upload file from local to SFTP remote server and delete local folder file after uploaded - only upload specify filename ... (3 Replies)
Discussion started by: weesiong
3 Replies
FGETC(3)                                                     Linux Programmer's Manual                                                    FGETC(3)

NAME
fgetc, fgets, getc, getchar, ungetc - input of characters and strings SYNOPSIS
#include <stdio.h> int fgetc(FILE *stream); char *fgets(char *s, int size, FILE *stream); int getc(FILE *stream); int getchar(void); int ungetc(int c, FILE *stream); DESCRIPTION
fgetc() reads the next character from stream and returns it as an unsigned char cast to an int, or EOF on end of file or error. getc() is equivalent to fgetc() except that it may be implemented as a macro which evaluates stream more than once. getchar() is equivalent to getc(stdin). fgets() reads in at most one less than size characters from stream and stores them into the buffer pointed to by s. Reading stops after an EOF or a newline. If a newline is read, it is stored into the buffer. A terminating null byte ('') is stored after the last character in the buffer. ungetc() pushes c back to stream, cast to unsigned char, where it is available for subsequent read operations. Pushed-back characters will be returned in reverse order; only one pushback is guaranteed. Calls to the functions described here can be mixed with each other and with calls to other input functions from the stdio library for the same input stream. For nonlocking counterparts, see unlocked_stdio(3). RETURN VALUE
fgetc(), getc() and getchar() return the character read as an unsigned char cast to an int or EOF on end of file or error. fgets() returns s on success, and NULL on error or when end of file occurs while no characters have been read. ungetc() returns c on success, or EOF on error. ATTRIBUTES
For an explanation of the terms used in this section, see attributes(7). +--------------------------+---------------+---------+ |Interface | Attribute | Value | +--------------------------+---------------+---------+ |fgetc(), fgets(), getc(), | Thread safety | MT-Safe | |getchar(), ungetc() | | | +--------------------------+---------------+---------+ CONFORMING TO
POSIX.1-2001, POSIX.1-2008, C89, C99. It is not advisable to mix calls to input functions from the stdio library with low-level calls to read(2) for the file descriptor associ- ated with the input stream; the results will be undefined and very probably not what you want. SEE ALSO
read(2), write(2), ferror(3), fgetwc(3), fgetws(3), fopen(3), fread(3), fseek(3), getline(3), gets(3), getwchar(3), puts(3), scanf(3), ungetwc(3), unlocked_stdio(3), feature_test_macros(7) COLOPHON
This page is part of release 4.15 of the Linux man-pages project. A description of the project, information about reporting bugs, and the latest version of this page, can be found at https://www.kernel.org/doc/man-pages/. GNU 2017-09-15 FGETC(3)
All times are GMT -4. The time now is 12:02 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy