Home Discussion Discuss: C array of pointers

• arraysri November 16, 2011 at 6:24 PM

very clear notes

• hikumar February 8, 2012 at 12:52 AM

plz send clear explanation of following program: main() { char c[]="gate2011"; char *p=c; printf("%s",p+p[3]-p[1]); }

• c++sanjeev kumar May 19, 2012 at 7:33 AM

its very good subject

• thanksshan June 15, 2012 at 5:21 PM

thanks for post this topic its very useful :D

• Array of PointersBen November 17, 2012 at 12:51 AM

If I have an array of pointers as you defined above: ie. float *float_ptr[4] and I wanted to do the following: store the data set [0 1 2 3 4 5] into float_ptr[0] and store [0 1 3 4 8 10] into float_ptr[1] similarly for the next two, how would I go about doing that? I have an idea as listed below, however the syntax doesn't yield the results I want, obviously which is why I am writing you. int j, i; int array1[24] = {0, 1, 2, 3, 4, 5 , 0, 1, 3, 4, 8, 10, 1, 9, 3, 4, 6, 21, 0, 1, 1, 9, 6, 12}; float *float_ptr[4], a, b, c, d; for (j = 0; j < 4; j++) { for (i = 0; i < n; i++) { if (i == 0) { a = (float)array1[i * 4 + j] - 1.88; float_ptr[chan_int][i * 4 + j] = a; } else if (i == 1) { b = (float)array1[i * 4 + j] - 1.88; float_ptr[chan_int][i * 4 + j] = b; } else if (i == 2) { c = (float)array1[i] - 1.88; float_ptr[chan_int][i * 4 + j] = c; } else if (i == 3) { d = (float)array1[i] - 1.88; float_ptr[chan_int][i * 4 + j] = d; } } } As you can see there is a double index for float_ptr, which is the issue, and I am not sure what to replace this with. Thanks!! -Ben

• c,c++suhasini February 21, 2013 at 6:44 AM

is there any need to learn these language? ........kindly plz tell me

Subject (*):

Related Articles
C Tutorials

Array of String using Pointers
of string using pointers in C. The declaration of an array of character pointers... Array of String using Pointers   .... In the example below, A two element array of character pointers where each element

C Tutorials

C array of pointers
C array of pointers       In this section, you will learn how to create array of pointers..., we have created an array of pointers of maximum size 3. Then we have assigned

Java Interview Questions

Java pointers
Java pointers   Why Java does not support pointers

Java Interview Questions

Java pointers
Java pointers  Why Java does not support pointers

Java Beginners

pointers in java - Java Beginners
pointers in java  Why pointers concept are not used in java

Java Interview Questions

Pointers - Java Interview Questions
Pointers  Why Pointer are not used in JAVA?  There is no need to store the address of the another variable in java So that pointers are not used in java

Java Beginners

java pointers - Java Beginners
variable in java So that pointers are not used in java."how it is different from C & C++?Please give an example?  pointr facilitats us to access diectly any address.ok and in c++ if we have any pointer to pointing a private

Development process Questions

memory span and shrink - pointers
memory span and shrink - pointers  Memory span and shrink as per application requirement and this is one of major advantage of pointer. please explain the above statment with an example with respect to c

Java Beginners

calculate size of array
calculate size of array  Is it possible to calculate the size of array using pointers in Java

Java Beginners

What is a pointer and does Java support pointers?
What is a pointer and does Java support pointers?   Hi, What is a pointer and does Java support pointers? Thanks   Hi, Pointer is a reference handle to a memory location. Improper handling of pointers leads

PHP Questions

in_array
in_array  in_array in php

PHP Questions

is _array()
is _array()  is_array() in php   Hi Friend, This function is of Boolean type.It checks whether a variable is an array or not. Here is an example: <?php \$yes = array('Hello', 'World'); echo is_array(\$yes) ? 'Array

PHP Questions

is _array()
is _array()  is _array()   Hi Friend, This function is of Boolean type.It checks whether a variable is an array or not. Here is an example: <?php \$yes = array('Hello', 'World'); echo is_array(\$yes) ? 'Array

C Tutorials

C array sort example
C array sort example       In this section, you will learn how to sort an array in C. For sorting an array, we have used the qsort function. This function provides

Java Beginners

Array
Array  how can i use elements of an array in a circular form? that is if the searching of the element reach the last elements of the array, then it will start serching from the begining of the array

Java Beginners

Array
Array  is it possible to define array like this..? int[] intArray = new int[] {4,5,6,7,8}; Explain...?   Yes, you can. Java Initialize Array

Java Beginners

Array
Array  What if i will not declare the limit index of an array, how will I declare an array and store values with it using loop?   Hi Friend...(System.in); int array[]=new int[5]; System.out.println("Enter Array Elements

Framework Questions

array
array  write and test a function named mirror that is passed an array of n floats and returns a newly created array that contains those n floats... the array {10.1,11.2,8.3,7.5,22} into{22,7.5,8.3,11.2,10.1

Java Beginners

array
array  write and test a function named mirror that is passed an array of n floats and returns a newly created array that contains those n floats... the array {10.1,11.2,8.3,7.5,22} into{22,7.5,8.3,11.2,10.1

PHP Questions

array
array  write and test a function named mirror that is passed an array of n floats and returns a newly created array that contains those n floats... the array {10.1,11.2,8.3,7.5,22} into{22,7.5,8.3,11.2,10.1

Java Beginners

Array
Array  How do i insert elements into an array up to a limit from...("Enter Range: "); int size=input.nextInt(); int array[]=new int[size]; System.out.println("Enter Array Elements: "); for(int i=0;i<

Java Beginners

array
array  WAP in java to store 6 element in array P and 4 element in array Q. Produce the third arra y R containing all element from p & q

Java Beginners

array
array  array memory allocation is dynamic or static in java   Java Arrays have dynamic memory allocation

Java Interview Questions

Array
Array  can we create an array of size 1 lakh in java programming

Design concepts & design patterns Questions

array
accepts a pointer to integer which represents an array of integer.After that this method prints the entire of the array numbers to the monitor. include using std::cout; using std::endl; void printArray(int *array, int count

Java Beginners

array
array  take a 2d array and display all its elements in a matrix fome using only one for loop and ple explain the program in below

Java Beginners

array
array  create an array in which no element is duplicate. if duplicate then tell to user duplicate. duplicacy is tell to user during when he enter the element

Java Beginners

array
array  create an array in which no element is duplicate. if duplicate then tell to user duplicate. duplicacy is tell to user during when he enter the element

Java Beginners

array
array  How to store the results of mysql query in an array... qurey in array: "select distinct(EMPLID)from tblwork where EMPLID not in (select... store the result in array

Java Beginners

array
array  wap to calculate reverse of 10 elements in an array?  ...++ ) { arr[i]=input.nextInt(); } System.out.print("Array... reversing, Array is: "); for(int i=arr.length-1;i>=0;i

Tutorial Topics
Questions by Category