GeekInterview.com
   Home |  Tech FAQ  |   Interview Questions |  Placement Papers |  Tech Articles |  Learn |  Freelance Projects |  Online Testing |  Geeks Talk |  Job Postings |  Knowledge Base | Site Search |  Add/Ask Question

GeekInterview.com  >  Tech FAQs  >  OOPS
Go To First  |  Previous Question  |  Next Question 
 OOPS  |  Question 226 of 255    Print  
How to allocate 2-dimension array for the int *p; in C++ using new.

  
Total Answers and Comments: 2 Last Update: September 24, 2007     Asked by: arun 
  
 Sponsored Links

 
 Best Rated Answer

No best answer available. Please pick the good answer available or submit your answer.
December 11, 2006 05:24:05   #1  
Babu j        

RE: How to allocate 2-dimension array for the int *p; ...

For creating [2]5] integer pointer

int ** p; 

p= new int*[2]; 

p[0] = new int[5];

p[1] = new int[5];


 
Is this answer useful? Yes | No
September 24, 2007 06:47:52   #2  
Mani        

RE: How to allocate 2-dimension array for the int *p; ...
int **p;
p=new int*[3];
for(int i=0;i<3;i++)
p[i]=new int[3];

Its equal to a[3][3] declaration

 
Is this answer useful? Yes | No

 Related Questions

Latest Answer : By useing the "far *". ...

Latest Answer : Arrays have to difine with fixed size it will not grow dynamically , vector size can be increased bydynamically and vectors are synchronized.yaa always right.vector is a standard template library in C++. Vector size can be increased dynamically and stores ...

What will happen if I allocate memory using "new" and free it using "free" or allocate sing "calloc" and free it using "delete"?

How will you declare an array of three function pointers where each function receives two ints and returns a float?

Latest Answer : Sorry, it is not same because arr stores the value where as &arr is the address of that value. ...

Latest Answer : yes, by mentioning the name of array we get the base address of the array ...


Latest Answer : ptr=realloc(ptr,newsize);This function allocates a new memory space of size  newsize to the pointer variable ptr  and returns a pointer to the first byte of the new memory block.The new size may be smaller or larger than the size.If the function ...

Latest Answer : Create a new array and copy the old one in it. ...

Latest Answer : The largest possible memory block malloc can allocate depends on the host system, particularly the size of physical memory and the operating system implementation. Theoretically, the largest number should be the maximum value that can be held in a size_t ...


 Sponsored Links

 
Related Articles

OOPS Tutorials

Object oriented programming OOP is a computer science term used to characterize a programming language that began development in the 1960&rsquo; s The term object oriented programming&rsquo; was originally coined by Xerox PARC to designate a computer application that describes the methodol
 

What is Data Dimension

Data Dimension is mainly used in data warehouse implementations. A data warehouse is implemented to that organizations can profit from data driven operation which constitute a major component in running businesses these days. To be effective with a data driven operation, data which is the basis for
 

JavaScript Array Operations

JavaScript Array Operations In this JavaScript tutorial you will learn about different operations with array in JavaScript how to use the for in statement Combining Operations between arrays and within elements of an array joining two or more arrays and joining elements of an arrays along with synta
 

JavaScript Array Object Methods – Part II

JavaScript Array Object Methods Part II In this JavaScript tutorial you will learn about on array object methods slice splice toString shift and unshift methods along with general syntax and examples mosgoogle center slice By using the methods of the array object the programmer is able to retriev
 

JavaScript Array Object Methods – Part I

JavaScript Array Object Methods Part I In this JavaScript tutorial you will learn about Array Object Methods concat join pop push and reverse methods&nbsp; along with general syntax and examples mosgoogle center concat The concat method is used to join two or more Array objects together to pro
 

JavaScript Array Object

JavaScript Array Object In this JavaScript tutorial you will learn about JavaScript Array Object its properties and methods mosgoogle center Usage of the Array Object The Array object is used to store a set of values in a single variable name There are many operations involved with Array object De
 

The Inheritance Concept In OOPs

The Inheritance Concept In OOPs In object oriented programming objects will be characterised by classes It is possible to learn a lot about an object based on the class it belongs to Even if you are not familiar with the name Maybach If I told you it is a car you would immediately know that it has f
 

Understanding The Message Concept In OOPs

Understanding The Message Concept In OOPs To understand object oriented programming you will need to become familiar with messages As the name implies a message is a process in which software objects will communicate with one another Because of this having one object is not enough mosgoogle An objec
 

Basic concepts of OOPS and Structure of C++ program

Basic concepts of OOPS and Structure of C program In this tutorial you will learn about Objects Classes Inheritance Data Abstraction Data Encapsulation Polymorphism Overloading Reusability Before starting to learn C it is essential that one must have a basic knowledge of the concepts of Object orie
 

Tutorial 66: MSAS - Applying security to a Dimension

When roles are assigned for cubes the user has access or no access to the cube When roles are assigned to a dimension the user gains only partial access to parts of the cube The simplest method of restricting access to a dimension is to prevent access to all levels except the top level of the dimens
 





About Us  |   Privacy Policy  |   Terms and Conditions  |   Contact  |   Site Map  |   Add Question  |   Propose Category  |   RSS Feeds  |   Articles Sitemap  |   Site Updates  |   Add Resource

Copyright © 2005 - 2008 GeekInterview.com. All Rights Reserved
Page copy protected against web site content infringement by Copyscape