Purchase Solution

Example of C Pointers

Not what you're looking for?

Ask Custom Question

Given the declaration;

int x;
int *p;
int *q;

Mark the following statements that are invalid only. Then explain why it is invalid.
p=q; Answer:
*p=56; Answer:
p=x; Answer:
*p=*q; Answer:
q = &x; Answer:
*p = q; Answer:

Purchase this Solution

Solution Summary

The solution includes code snippets which explains some common mistakes done with pointers in C.

Solution Preview

p=x; Answer: Invalid. p is a pointer which holds an address of an ...

Purchase this Solution


Free BrainMass Quizzes
Java loops

This quiz checks your knowledge of for and while loops in Java. For and while loops are essential building blocks for all Java programs. Having a solid understanding of these constructs is critical for success in programming Java.

Basic Networking Questions

This quiz consists of some basic networking questions.

C++ Operators

This quiz tests a student's knowledge about C++ operators.

Inserting and deleting in a linked list

This quiz tests your understanding of how to insert and delete elements in a linked list. Understanding of the use of linked lists, and the related performance aspects, is an important fundamental skill of computer science data structures.

C# variables and classes

This quiz contains questions about C# classes and variables.