Sponsored Content
Full Discussion: Pointers to Arrays
Top Forums Programming Pointers to Arrays Post 6258 by Jayathirtha on Saturday 1st of September 2001 08:21:19 AM
Old 09-01-2001
Question Pointers to Arrays

Below is the program i tried to execute......

main()
{
static int a[ ] = {0,1,2,3,4};
static int *p[ ] = {a, a+1, a+2, a+3, a+4};

printf (“\n %u %u %d”, p, *p, *(*p) );
}

This works, but i wanted to know why both a[ ] and *p[ ] are declared as "static". If we dont declare a[ ] as static then that gives me error, but if i dont declare *p[ ] as static then it works fine.
Tell me the significance of declaring them as "static".

Jay.
 

10 More Discussions You Might Find Interesting

1. Programming

Regarding Function and Pointers.

HI, Here is some thing that is puzzling me from a long time. Can some body explain me this with example. The question is :- What is the difference between function pointer and pointer to a function. Where do we actually use the function pointers and pointer to functions. Thanks in... (0 Replies)
Discussion started by: S.Vishwanath
0 Replies

2. Programming

Pointers and array

hi all, let say i have a pointer exit, and this exit will store some value. how can i store the value that the pointer points to into an array and then print them out from the array. thanks in advance (2 Replies)
Discussion started by: dianazheng
2 Replies

3. Shell Programming and Scripting

functiom pointers

Hi all i wonder about function pointers as i never used them in my C code . could any tell me why and where exactly function pointers come into picture . thanq (1 Reply)
Discussion started by: Raom
1 Replies

4. Programming

pointers

is this a valid c declaration int (*ptr(int *b)); plz explain... (4 Replies)
Discussion started by: areef4u
4 Replies

5. Programming

pointers

Hi I mash with pointers in C. I solve this problem about 5 hours and I don't know how I should continue. void InsertFirst (tList *L, int val) { tElemPtr new; if((new = malloc(sizeof(tElemPtr))) == NULL) Error(); new->data = val; new->ptr = L->frst; L->frst = new;... (2 Replies)
Discussion started by: Milla
2 Replies

6. Programming

Need help with the Pointers in C

I have a special character called ô. When it is declared as a character variable its showing it can be printed. But when it is declared as a character pointer variable its showing it cannot be printed. I am just wondering why its happening like this.. c1 = '@'; c2 = 'ô'; char *fp; fp="XXô"; if... (1 Reply)
Discussion started by: sivakumar.rj
1 Replies

7. Programming

Problem With Pointers

Hi guys. What is the difference between these: 1. int *a; 2. int (*a); (2 Replies)
Discussion started by: majid.merkava
2 Replies

8. Programming

question about int arrays and file pointer arrays

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

9. Programming

Pointer to pointers

Hi guys, I'm trying to understand pointers in C and made a simple example and I've problems with It. Can someone help? #include <stdio.h> #include <stdlib.h> #include <assert.h> int f1(char **str_); int main(int argc, char **argv) { char *str = NULL; f1(&str); ... (3 Replies)
Discussion started by: pharaoh
3 Replies

10. Programming

Pointers and array

Hello, I read from a book exercise for a challenge. How to print out each letter of char array a by two different pointers pa and ppa in the example? I have tried my code for letter "r" by testing without full understanding as only the first one worked. #include<stdio.h> int main() { char... (17 Replies)
Discussion started by: yifangt
17 Replies
SoComplexityElement(3)						       Coin						    SoComplexityElement(3)

NAME
SoComplexityElement - The SoComplexityElement class contains the current shape complexity for a graph traverser. SYNOPSIS
#include <Inventor/elements/SoComplexityElement.h> Inherits SoFloatElement. Public Member Functions virtual void init (SoState *state) FIXME: write doc. Static Public Member Functions static SoType getClassTypeId (void) static int getClassStackIndex (void) static void * createInstance (void) static void initClass (void) static void set (SoState *const state, SoNode *const node, const float complexity) FIXME: write doc. static void set (SoState *const state, const float complexity) FIXME: write doc. static float get (SoState *const state) FIXME: write doc. static float getDefault (void) FIXME: write doc. Protected Member Functions virtual ~SoComplexityElement () Additional Inherited Members Detailed Description The SoComplexityElement class contains the current shape complexity for a graph traverser. Constructor &; Destructor Documentation SoComplexityElement::~SoComplexityElement (void) [protected], [virtual] The destructor. Member Function Documentation SoType SoComplexityElement::getClassTypeId (void) [static] This static method returns the class type. Reimplemented from SoFloatElement. int SoComplexityElement::getClassStackIndex (void) [static] This static method returns the state stack index for the class. Reimplemented from SoFloatElement. void * SoComplexityElement::createInstance (void) [static] This API member is considered internal to the library, as it is not likely to be of interest to the application programmer. void SoComplexityElement::initClass (void) [static] This static method initializes static data for the SoComplexityElement class. Reimplemented from SoFloatElement. Author Generated automatically by Doxygen for Coin from the source code. Version 3.1.3 Wed May 23 2012 SoComplexityElement(3)
All times are GMT -4. The time now is 10:21 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy