Consider the following c program #include #include void get_forest(int *str); main() { int field[80][80],i,j; for(i=0;i<80;i++) for(j=0;j<80;j+) field[i][j] = rand()%2; get_forest(field); } void get_forest(int *str) { printf("%d",*str); printf("%d",*(str+4)); } It seems that in get_forest the second print command cant print the actual value that means in this case field[3][0].How can I fix it?

At vero eos et accusamus et iusto odio dignissimos ducimus qui blanditiis praesentium voluptatum deleniti atque corrupti quos dolores et quas molestias excepturi sint occaecati cupiditate non provident, similique sunt in culpa qui officia deserunt mollitia animi, id est laborum et dolorum fuga. Et harum quidem rerum facilis est et expedita distinctio. Nam libero tempore, cum soluta nobis est eligendi optio cumque nihil impedit quo minus id quod maxime placeat facere possimus, omnis voluptas assumenda est, omnis dolor repellendus. Itaque earum rerum hic tenetur a sapiente delectus, ut aut reiciendis voluptatibus maiores alias consequatur aut perferendis doloribus asperiores repellat.

Get our expert's

answer on brainly

SEE EXPERT ANSWER

Get your free account and access expert answers to this and thousands of other questions.

A community for students.

Consider the following c program #include #include void get_forest(int *str); main() { int field[80][80],i,j; for(i=0;i<80;i++) for(j=0;j<80;j+) field[i][j] = rand()%2; get_forest(field); } void get_forest(int *str) { printf("%d",*str); printf("%d",*(str+4)); } It seems that in get_forest the second print command cant print the actual value that means in this case field[3][0].How can I fix it?

MIT 6.00 Intro Computer Science (OCW)
I got my questions answered at brainly.com in under 10 minutes. Go to brainly.com now for free help!
At vero eos et accusamus et iusto odio dignissimos ducimus qui blanditiis praesentium voluptatum deleniti atque corrupti quos dolores et quas molestias excepturi sint occaecati cupiditate non provident, similique sunt in culpa qui officia deserunt mollitia animi, id est laborum et dolorum fuga. Et harum quidem rerum facilis est et expedita distinctio. Nam libero tempore, cum soluta nobis est eligendi optio cumque nihil impedit quo minus id quod maxime placeat facere possimus, omnis voluptas assumenda est, omnis dolor repellendus. Itaque earum rerum hic tenetur a sapiente delectus, ut aut reiciendis voluptatibus maiores alias consequatur aut perferendis doloribus asperiores repellat.

Get this expert

answer on brainly

SEE EXPERT ANSWER

Get your free account and access expert answers to this and thousands of other questions

Python class, bro... Anyway, I think the second line would print out field[0][4]. If you want to print field[3][0], why not just replace that print statement with cout<
Thanks bro but I was wanting to do it with c and the Borland compiler did not give that expected result and I just want to know how I can access a string from another function using pointer arithmatic
Try using a one-dimensional string Not sure how it would interpret pointer arithmetic in a 2D array, but did you try printing *(field+3*80) ?

Not the answer you are looking for?

Search for more explanations.

Ask your own question

Other answers:

Thanks for that

Not the answer you are looking for?

Search for more explanations.

Ask your own question