Forgot to add that though the two statements are equivalent their difference is that this one allocates memory on the stack...
while the one below allocates memory from the heap...
and written as is the heap one uses more memory than the stack one unless written as shown in my previous post.
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)
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)
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 all,
Is there a way to convert full data matrix to linearised left data matrix?
e.g full data matrix
Bh1 Bh2 Bh3 Bh4 Bh5 Bh6 Bh7
Bh1 0 0.241058 0.236129 0.244397 0.237479 0.240767 0.245245
Bh2 0.241058 0 0.240594 0.241931 0.241975 ... (8 Replies)
Hi everyone
I am very new at awk but think that that might be the best strategy for this. I have a matrix very similar to a correlation matrix and in practical terms I need to convert it into a list containing the values from the matrix (one value per line) with the first field of the line (row... (5 Replies)
Does anyone know?
int x = 1;
int *p = &++x; //ok !
int *q = &x++; //gives an error :O
why the first pointer is ok but the second is an error? (13 Replies)
I am struggling with the pointer to 2D-array (cf: 2D array of pointers). Can anybody help me elaborate how the pointer x moves in the memory to access the individual of y, especially the high lighted lines?
I have talked to one of the curators of the forum, but I am still not quite clear.
Here... (1 Reply)
Discussion started by: yifangt
1 Replies
LEARN ABOUT DEBIAN
viewport
Viewport(3I) InterViews Reference Manual Viewport(3I)NAME
Viewport - scrollable view
SYNOPSIS
#include <InterViews/viewport.h>
DESCRIPTION
Viewport is a subclass of MonoScene that allocates its component exactly as much space as it wants (determined from its shape). This space
will be clipped to the viewport's size and the viewport maintains a perspective to adjust the portion of the component that is actually
displayed. If the component is smaller than the viewport's canvas, then the viewport background will be filled with a light gray pattern.
PUBLIC OPERATIONS
Viewport(Interactor* = nil, Alignment = Center)
Construct a new viewport. If the interactor is not nil, it is inserted as the viewport's component. The second parameter deter-
mines where the component is placed relative to the viewport.
Insert(Interactor*)
Set the component interactor.
void Change(Interactor*)
A viewport does not propagate changes. Thus, if the component's shape changes the viewport simply resizes the component according
to the new shape.
void Remove(Interactor*)
Take out the component interactor.
virtual void Adjust(Perspective&)
Change the viewport's perspective to the given one. This operation will cause the desired area of the component to be drawn.
void AdjustTo(float px, float py, float zx, float zy)
void AdjustBy(float dpx, float dpy, float dzx, float dzy)
void ScrollTo(float px, float py)
void ScrollXTo(float px)
void ScrollYTo(float py)
void ScrollBy(float dpx, float dpy)
void ScrollXBy(float dpx)
void ScrollYBy(float dpy)
void ZoomTo(float zx, float zy)
void ZoomXTo(float zx)
void ZoomYTo(float zy)
void ZoomBy(float dzx, float dzy)
void ZoomXBy(float dzx)
void ZoomYBy(float dzy)
Short-hand operations for explicit manipulation of the viewport's perspective.
float XPos()
float YPos()
float XMag()
float YMag()
Short-hand for retrieving information about the current perspective.
SEE ALSO Perspective(3I), Scene(3I), Shape(3I)InterViews 10 February 1988 Viewport(3I)