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  >  Interview Questions  >  Concepts  >  Data Structures
Go To First  |  Previous Question  |  Next Question 
 Data Structures  |  Question 189 of 193    Print  
What is a void pointer?

  
Total Answers and Comments: 1 Last Update: July 19, 2008     Asked by: mitulgolakiya 
  
 Sponsored Links

 
 Best Rated Answer

No best answer available. Please pick the good answer available or submit your answer.
July 19, 2008 01:34:49   #1  
aldoboyzzz Member Since: July 2008   Contribution: 1    

RE: What is a void pointer?

a pointer with no return type is called a null pointer.It may be any kind of datatype.It takes the data type according to the requirement in the program.

for eg:



 #include <iostream>
using namespace std;

void increase (void* data, int psize)
{
  if ( psize == sizeof(char) )
  { char* pchar; pchar=(char*)data; ++(*pchar); }
  else if (psize == sizeof(int) )
  { int* pint; pint=(int*)data; ++(*pint); }
}

int main ()
{
  char a = 'x';
  int b = 1602;
  increase (&a,sizeof(a));
  increase (&b,sizeof(b));
  cout << a << ", " << b << endl;
  return 0;
}


 
Is this answer useful? Yes | No

 Related Questions

Skill/Topic: Variables and PointersA) FalseB) TrueExplanation: A pointer is a variable and can be used as an element of a structure and as an attribute of a class in some programming languages such as 
Latest Answer : yeh, we can call pointer as a variable .it is used in some languages which supports its use.the datatype of pointer is of ptr,and not of datatype of the variable to which it is pointing. ...
Tags : Pointer

Skill/Topic: Variables and PointersA) Address, PointerExplanation: A pointer to a pointer is a variable whose value is an address of another pointer variable 
Latest Answer : address,pointer ...
Tags : Pointer

Skill/Topic: Variables and PointersA) arrange data by moving data in memoryB) arrange data by moving pointer in memoryC) arrange data without having to move data in memory.D) None of the aboveExplanation: 
Latest Answer : ans: C ...
Tags : Pointer

Skill/Topic: Variables and PointersA) The data type in this is CharExplanation: The data type of the memory address stored in the pointer is of Character type 
Latest Answer : The datatype is char * type that is the variable points to a location(stores the address of the location) which contains character type data ...

Skill/Topic: Variables and PointersA) Tells the computer that you are declaring a pointerB) Tells the computer that you are declaring a variableC) Both a) and b)D) None of the aboveExplanation: The symbol 
Latest Answer : ans: A ...

Skill/Topic: Variables and PointersA) pointer dereferencing operatorExplanation: (sometimes called as dereferencing operator) 
Latest Answer : deferencing operator. ...

Skill/Topic: ArrayA) A multidimensional array can be useful to organize subgroups of data within an array. In addition to organizing data stored in elements of an array, a multidimensional array can store 
Latest Answer : Multidimensional arrays are used to store information in a matrix form -- e.g. a railway timetable, schedule cannot be stroed as a single dimensional array.You may want to use a 3-D array for storing height, width and lenght of each room on each floor ...

Skill/Topic: ArrayA) by using the address operator, which is the ampersand (&), in an assignment statementB) by using the address operator, which is the asterisks (*), in an assignment statementC) by 
Latest Answer : sayint * ptoia[10];int a=10;so we can writeptoia[0]=&a;.... and so on,. ...
Tags : Pointer

_________ is the way you groups things together by placing one thing on top of another and then removing things one at a time from the top.
Skill/Topic: Stacks using an ArrayA) ArrayB) StackC) PointerD) All of the above  

Skill/Topic: Linked ListA) TrueB) FalseExplanation: Yes, a node can reference more than one data element if the current data element of the node is a pointer to a group of data such as an instance of 
Latest Answer : Yes, a node itself can contain as many data elements as it needs and it can also reference other data elements. Following is an example of a complex node strcuture in a linked liststruct linkList{struct empNode{string empName;long empNo;struct empSal ...


 Sponsored Links

 
Related Articles

Breaking up XML into Relational Data

Breaking up XML into Relational Data While the preceding example shows how to construct an XML representation over relational data the example in this section illustrates how you can shred XML data back into relational data This reverse operation can be useful if your application works with relation
 

Querying Data with Oracle XQuery

Querying Data with Oracle XQuery Starting with Oracle Database 10g Release 2 you can take advantage of a full featured native XQuery engine integrated with the database With Oracle XQuery you can accomplish various tasks involved in developing PHP Oracle XML applications operating on any kind of dat
 

Retrieving XML Data

Retrieving XML DataTo retrieve XML data from an XMLType table you can use a SELECT SQL statement just as you would if you had to query a relational table For example to select the employee with the id set to 100 from the employees XMLType table discussed in the preceding section you might issue the
 

Using XMLType for Handling XML Data in the Database

Using XMLType for Handling XML Data in the Database Being an object type XMLType can not only be used to store XML data in the database but also to operate on that data via its built in methods Regardless of the storage model you choose XMLType provides a set of XML specific methods to operate on XM
 

Using Oracle Database for Storing, Modifying, and Retrieving XML Data

Using Oracle Database for Storing Modifying and Retrieving XML Data With Oracle XML DB you have various XML storage and XML processing options allowing you to achieve the required level of performance and scalability One of the most interesting things about Oracle XML DB is that it allows you to per
 

ODP.NET - Techniques to Improve Performance while Retrieving Data

ODP NET Techniques to Improve Performance while Retrieving Data Performance tuning is a great subject in Oracle Volumes of books would not be enough to cover every aspect of performance tuning in Oracle However in this section we will only discuss the fundamental performance techniques while working
 

ODP.NET - Populating a Dataset with a Single Data Table

ODP NET Populating a Dataset with a Single Data Table A dataset is simply a group of data tables These data tables can be identified with their own unique names within a dataset You can also add relations between data tables available in a dataset mosgoogle The following code gives you the details o
 

ODP.NET - Retrieving Typed Data

ODP NET Retrieving Typed Data While retrieving values from OracleDataReader we can extract information available in individual columns of a particular row either by using column ordinal position values or column names mosgoogle Retrieving Typed Data Using Ordinals ODP NET provides data specific enum
 

ODP.NET - Retrieving Data Using OracleDataReader

ODP NET Retrieving Data Using OracleDataReader OracleDataReader is simply a read only and forward only result set It works only if the database connection is open and it makes sure that the connection is open while you are retrieving data As the data that it retrieves is read only it is a bit faster
 

ODP.NET - Fundamental ODP.NET Classes to Retrieve Data

ODP NET Fundamental ODP NET Classes to Retrieve Data To retrieve data from an Oracle database using ODP NET we need to work with a few of the ODP NET classes At this point we will discuss the most fundamental classes available in ODP NET for retrieving data mosgoogle The following is the list of fun
 





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