Computer Programming in C for Beginners by Avelino J. Gonzalez

Computer Programming in C for Beginners by Avelino J. Gonzalez

Author:Avelino J. Gonzalez
Language: eng
Format: epub, pdf
ISBN: 9783030507503
Publisher: Springer International Publishing


Output:ptr = 3004

Of course, this assumes that an integer variable takes 4 bytes (32 bits) in the computer where this code is run.

Since char variables are 1 byte in size, the arithmetic will be normal for pointers that point to character variables. Let’s do some brief examples. Because we can’t predict what addresses will be assigned, or even know whether one’s computer uses a 16-, 32- or 64-bit integer, the results will only be relevant to the computer you are using, as well to when you are using it; running the same program at a different time, after the computer has been used for other things, may yield different addresses on the same computer.

int main()

{

int * ptr1 = NULL, * ptr2 = NULL;

int var;



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.