Sponsored Content
Top Forums Programming difference between int ** func() and int *& func() Post 91776 by linuxpenguin on Monday 5th of December 2005 01:34:31 PM
Old 12-05-2005
do you have linux installed. if yes try to use the cdecl utility

this is what i get

cdecl> explain int * *p()
declare p as function returning pointer to pointer to int
cdecl> explain int * &p()
Warning: Unsupported in C -- 'reference'
declare p as function returning reference to pointer to int
cdecl>

so int **func() is a function that returns a pointer to a pointer to int and int * & func() is a function that returns an reference to a pointer to a function, and as seen above the second statement is not supported in C, you can try it in c++ tho.
 

7 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Utilizing func keys in scripts

I would like to have the function keys available to me in my scripts. Anyone have any ideas on how to map these to functionality I design? :confused: (3 Replies)
Discussion started by: fjjlee
3 Replies

2. Shell Programming and Scripting

FLOOR Func

Hello Experts, Is there any inbuild FLOOR function to do FLOOR func in mathmetics in awk script like in FlOOR Func in C. Ex:- floor(2.9) = 2 floor(2.1) = 2 floor(2.0) = 2 floor(-2.0) = 2 floor(-2.1) = -3 floor(-2.9) =... (1 Reply)
Discussion started by: user_prady
1 Replies

3. UNIX for Dummies Questions & Answers

int open(const char *pathname, int flags, mode_t mode) doubt...

hello everybody! I want to create a file with permissions for read, write, and execute to everybody using C, so I write this code: #include <stdio.h> #include <sys/types.h> #include <sys/stat.h> #include <fcntl.h> int main(){ int fileDescriptor; fileDescriptor =... (2 Replies)
Discussion started by: csnmgeek
2 Replies

4. Red Hat

Video: Spotlight on FUNC

</p>Download this video: Ogg Theora] FUNC is the brainchild of Michael DeHaan, Adrian Likins, Seth Vidal, and Greg DeKoenigsberg. In this edition of Spotlight On, Michael, Adrian, and Seth discuss how FUNC makes it easy to write commands across large numbers of machines remotely and... (0 Replies)
Discussion started by: Linux Bot
0 Replies

5. Programming

Handle int listen(int sockfd, int backlog) in TCP

Hi, from the manual listen(2): listen for connections on socket - Linux man page It has a parameter called backlog and it limits the maximum length of queue of pending list. If I set backlog to 128, is it means no more than 128 packets can be handled by server? If I have three... (3 Replies)
Discussion started by: sehang
3 Replies

6. Shell Programming and Scripting

Advanced AWK Regexp substring to int & Replace

Hi! I have a difficult problem, to step up a unknown version number in a text file, and save the file. It would be great to run script.sh and the version gets increased. Example the content of the textfile.txt hello version = x bye This include three steps 1. First find the char after... (2 Replies)
Discussion started by: Beachboy72
2 Replies

7. Shell Programming and Scripting

Bash shell script: Str(007) to int(7),increment it(8) & convert back to string(008)

Hi, I have the following requirement. There will be following text/line in a file (eg: search-build.txt) PRODUCT_VERSION="V:01.002.007.Build1234" I need to update the incremental build number (eg here 007) every time I give a build through script. I am able to search the string and get... (4 Replies)
Discussion started by: drwatson_droid
4 Replies
ttyname(3)						     Library Functions Manual							ttyname(3)

NAME
ttyname, isatty, ttyname_r - Get the name of a terminal LIBRARY
Standard C Library (libc.so, libc.a) SYNOPSIS
#include <unistd.h> char *ttyname( int file-descriptor); int isatty( int file-descriptor); int ttyname_r( int file-descriptor, char *buffer, int len); STANDARDS
Interfaces documented on this reference page conform to industry standards as follows: ttyname_r(): POSIX.1c isatty(), ttyname(): XSH4.2 Refer to the standards(5) reference page for more information about industry standards and associated tags. PARAMETERS
Specifies an open file descriptor. Points to a buffer in which the terminal name is stored. Specifies the length of the buffer pointed to by the buffer parameter. DESCRIPTION
The ttyname() function gets the name of a terminal. It returns a pointer to a string containing the null-terminated pathname of the termi- nal device associated with the file-descriptor parameter. The isatty() function determines if the device associated with the file-descriptor parameter is a terminal. NOTES
The ttyname() function returns a pointer to thread-specific data. Subsequent calls to this function from the same thread overwrite this data. RETURN VALUES
Upon successful completion, the ttyname() function returns a pointer to a string identifying a terminal device. A NULL pointer is returned if the file-descriptor parameter does not describe a terminal device in the /dev directory. Upon successful completion, the isatty() function returns a value of 1 if the specified file-descriptor parameter is associated with a ter- minal. Otherwise, it returns a value of zero (0). [POSIX] Upon successful completion, the ttyname_r() function stores the terminal name as a null-terminated string in the buffer pointed to by the buffer parameter and returns a value of 0 (zero). Otherwise, it returns an error number. [Tru64 UNIX] The obsolete version of ttyname_r() functions the same way as the POSIX version, except it returns a -1 upon unsuccessful completion. ERRORS
If the isatty() function fails, errno may be set to the following value: The file associated with file-descriptor is not a terminal. If the ttyname_r() function fails, errno may be set to the following value: The buffer parameter is a null pointer or the len parameter was too short to store the string. RELATED INFORMATION
Functions: ttyslot(3) Standards: standards(5) delim off ttyname(3)
All times are GMT -4. The time now is 11:36 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy