Originally Posted by
thatguy
I am currently working to teach myself C and move on to other languages from there. I have been working for about two weeks on coding, etc and I have hit a wall at arrays and pointers. Please help if you can. Here is a list of questions I am attempting to answer:
For each of the following, write a single statement that performs the indicated task. Assume that long integer variables value1 and value2 have been defines and that value 1 has been initialized to 200000.
a. Define the variable lPtr to be a pointer to an object of type long.
b. Assign the address of variable value1 to pointer variable lPtr.
c. Print the value of the object pointed to by lPtr.
d. Assign the value of the object pointed to by lPtr to variable value2.
e. Print the value of value2.
f. Print the address of value1.
g. Print the address stored in lptr. Is the value printed the same as the address of value1?
Write a printf of scanf statement for each of the following:
a. Print unsigned integer 40000 left justified in a 15-digit field with 8 digits.
b. Read a hexadecimal value into variable hex.
c. Print 200 with and without a sign.
d. Print 100 in hexadecimal form preceded by 0x.
e. Read characters into array s until the letter p is encountered.
Thanks,
ThatGuy