Need help to solve this. | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

Need help to solve this.

The starting address of a character Array S[20] is 0x00102H, if the size of array is 20 and each element of the array contains a single character; calculate the memory address of last location of character array. Calculate memory location of S[0]. Display the character at S[11].

21st Jul 2020, 1:17 PM
Ikram Arshad
Ikram Arshad - avatar
10 Answers
+ 3
Adding to ~ swim ~ , We add it by 20 because it is an array of characters and size of character is 1 byte. If it were to be an integer we would have to add the memory address by 4 * 20 or 80 bytes. Also don't forget to the size is represented is decimal and memory address is in hex. Otherwise you will get weird answers. :)
21st Jul 2020, 1:51 PM
Ćheyat
Ćheyat - avatar
+ 3
~ swim ~ Just wanted to clarify to others if they get confused. ;)
21st Jul 2020, 1:56 PM
Ćheyat
Ćheyat - avatar
+ 2
Okay dude, let me see your code and I'll see what I can do. Follow the below guide to share your code in case you don't know. But I don't write you code okay? I help you get it to work, as I can of course ... https://www.sololearn.com/post/75089/?ref=app
21st Jul 2020, 1:34 PM
Ipang
0
What is there to calculate for memory location of S[0]? That's the line at the second to last paragraph ...
21st Jul 2020, 1:29 PM
Ipang
0
Thats the second second thing we have to do in program
21st Jul 2020, 1:30 PM
Ikram Arshad
Ikram Arshad - avatar
0
I wrote the question as i received
21st Jul 2020, 1:31 PM
Ikram Arshad
Ikram Arshad - avatar
0
I need help to start,idk how to calculate memory
21st Jul 2020, 1:36 PM
Ikram Arshad
Ikram Arshad - avatar
0
Actually dude, even I get confused by that instruction, now I'm not sure I could help you out ...
21st Jul 2020, 1:38 PM
Ipang
0
I am unable to get help from google too
21st Jul 2020, 1:40 PM
Ikram Arshad
Ikram Arshad - avatar
0
Hi
23rd Jul 2020, 1:02 PM
Mustapha Musty
Mustapha Musty - avatar