Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

C PROGRAMMING fix code in each of these pointer tests so they all work properly //[1] void pointerTest1() { //char *c; //float x = 10;

C PROGRAMMING
fix code in each of these pointer tests so they all work properly
//[1] void pointerTest1() { //char *c; //float x = 10; //c = &x; //printf("%d", *c); } //[2] void pointerTest2() { //float x = 10.25; //float* f; ////f = x; //printf("%g", *f); } //[3] void pointerTest3() { //char sa[] = "How are you?"; //char t; //char* f; //f = &sa; //printf("%s", f); } //[4] void pointerTest4() { //int* t; //int x; //t = &x; //x = 11; //*t++; //printf("%d", *t); } //[5] void pointerTest5() { //int t[] = { 1,2,3,4,5 }; //int* p; //int* q; //int* r; //p = t; //q = p[1]; //r = p[2]; //printf("%d %d %d", *p, *q, *r); } //[6] // In the assignment statement *pz is required. void pointerTest6() { //int x = 5; //int y = 8; //int z; //int* px; //int* py; //int* pz; //px = &x; //py = &y; //pz = &z; //pz = *px + *py; //printf("%d", z); } //[7] void pointerTest7() { //double x = 5; //double *px = &x; //double* py; //printf("%d", px); } //[8] void pointerTest8() { //int x; //int* px; //*px = 5; //px = &x; //printf("%d", x); } //[9] void pointerTest9() { //int a; //int *p; //int* q; //a = 2; //p = &a; //q = p; //printf("%d %d", p, q); } //[10] void pointerTest10() { //int y[] = { 1,2,3 }; //int* p; //p = &y[1]; //printf("%d %d", (1 + y), *p); } //[11] void pointerTest11() { //unsigned int y[] = { 65555,65550,65543 }; //printf("%u", y[2]); } //[12] void pointerTest12() { //int p[] = { 1,2,3,4 }; //char* c; //c = p; //printf("%d", *c); }

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Sams Teach Yourself Beginning Databases In 24 Hours

Authors: Ryan Stephens, Ron Plew

1st Edition

067232492X, 978-0672324925

More Books

Students also viewed these Databases questions