void main()
{
int a={1,2,3,4,5,6,7,8,9,10};
int *p=a;
int *q=&a;
cout<<q-p+1<<endl;
}
The output is 10, how?
if we give cout<<q it will print the address, value won't print....
if we give cout<<p it will print the address, value won't print....
p has the base addr; q... (1 Reply)
Hi everybody,
i am newbie to unix and confused with file pointers and file descripters.
could anyone help me to clear my doubts ..
when we call unix system calls to create a file then we are dealing wih file descripters
i think file descripters are also normals file as stored inhard disks... (1 Reply)
can u tell me the reson that why we should not delete a pointer twice.?
if we delete ponter twice then what happen and why this happen
Regards,
Amit (2 Replies)
I have a text file that has blocks of text. Each block starts with ### and ends with End_###.
I wrote a perl script to search a string from line 2 (ignore any line starts with ###) of each block
if matched, need to print that whole block. According to the input file in below, it will print... (5 Replies)
Hello experts,
I ve a text file I want to go to particular line . what is the best way to do this in c ?
I am tried as follows
fseek ( fh, pos, SEEK_SET);
but this functions moves the file pointer according to a number of bytes. Unfortunately I don't know the exact byte... (7 Replies)
If one wants to get a start address of a array or a string or a block of memory via a function, there are at least two methods to achieve it:
(1) one is to pass a pointer-to-pointer parameter, like:
int my_malloc(int size, char **pmem)
{
*pmem=(char *)malloc(size);
if(*pmem==NULL)... (11 Replies)
hi....,
can anyone tell me what is the exact difference between file descriptor and file pointer...... and why file descriptor takes integer value???:confused: (10 Replies)
if i declare both but don't input any variables what values will the int array and file pointer array have on default, and if i want to reset any of the elements of both arrays to default, should i just set it to 0 or NULL or what? (1 Reply)
Discussion started by: omega666
1 Replies
LEARN ABOUT OPENDARWIN
close
close(n) Tcl Built-In Commands close(n)
__________________________________________________________________________________________________________________________________________________NAME
close - Close an open channel.
SYNOPSIS
close channelId
_________________________________________________________________DESCRIPTION
Closes the channel given by channelId.
ChannelId must be an identifier for an open channel such as a Tcl standard channel (stdin, stdout, or stderr), the return value from an |
invocation of open or socket, or the result of a channel creation command provided by a Tcl extension.
All buffered output is flushed to the channel's output device, any buffered input is discarded, the underlying file or device is closed,
and channelId becomes unavailable for use.
If the channel is blocking, the command does not return until all output is flushed. If the channel is nonblocking and there is unflushed |
output, the channel remains open and the command returns immediately; output will be flushed in the background and the channel will be |
closed when all the flushing is complete.
If channelId is a blocking channel for a command pipeline then close waits for the child processes to complete.
If the channel is shared between interpreters, then close makes channelId unavailable in the invoking interpreter but has no other effect |
until all of the sharing interpreters have closed the channel. When the last interpreter in which the channel is registered invokes close, |
the cleanup actions described above occur. See the interp command for a description of channel sharing. |
Channels are automatically closed when an interpreter is destroyed and when the process exits. Channels are switched to blocking mode, to |
ensure that all output is correctly flushed before the process exits.
The command returns an empty string, and may generate an error if an error occurs while flushing output.
SEE ALSO
file(n), open(n), socket(n), eof(n), Tcl_StandardChannels(3)KEYWORDS
blocking, channel, close, nonblocking
Tcl 7.5 close(n)