Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8005793
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T17:19:03+00:00 2026-06-04T17:19:03+00:00

I know it is a very basic question. I have read memory management from

  • 0

I know it is a very basic question. I have read memory management from Wikipedia and couple of MSDN pages. But still I’m not sure how does below processing happens during a program execution.

When I declare a long string within my program

  1. Which memory compiler use to store the value? (I think it is RAM)
  2. How much memory spaces does it takes? (Considering it is a 8 bit machine and string like ‘I’m a novice in computer programming’)
  3. When I update the string value in run time how compiler knows in which memory address string value is present
  4. When I create a matrix then how individual values get stored into memory?

Please consider I’m using C# in .Net and here is my string s = ‘I’m a novice in computer programming’

Thanks in advance.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T17:19:04+00:00Added an answer on June 4, 2026 at 5:19 pm

    First part, the strings.

    As many people have told you, there are many ways to represent a string. The most common thing to do is to store the string as an array. However, you need some extra information: the length of this array.

    Each (procedural or imperative) language solves this problem differently.

    1. There “pascal strings”, where the first few bytes of the array store the length of the string.

    2. There are “C string or null-terminated strings”, where there are no additional bytes to store the length, but the last byte in the array has zero value.

    3. In COM a hybrid approach is used, the BSTR. It uses 4 bytes at the beginning to store the string’s length and a two-byte marker (two zero bytes) at the end. It allows to pass the string to C procedures and at the same time to get the length quickly.

    Functional languages are a whole different store.

    Second part, the matrices.

    To store a multidimensional (two-dimensional in your case) array one has to “linearize” it, i.e., turn it to the one-dimensional array to use the computer’s memory hardware.

    So to store the

    float A[W][H];
    

    you allocate at least

    sizeof(float)*W*H
    

    bytes of memory to store the data. The access to A[i][j] is done by accessing the memory bytes at the address

    addr(A) + (i * H + j)
    

    or the address

    addr(A) + (j * W + i)
    

    These are two approaches employed by C and Fortran.

    However, if you need to store some sparse matrix, there might be some other options. You could, for example, store triples (i,j,value) representing the non-zero elements of the matrix.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a very basic question, but I don't know the answer, unfortunately, google-ing
I know this is a very basic question but I have kinda been thrown
I know, this might be a very basic question but I am not 100%
Ok, I know this is a very basic question, but my head is swimming
guys I know this question is very basic but I've met in few publications
I have a very basic question how the creation of HTTPSession works.I know you
i know this is a very basic question and i know i have done
I know this is very basic question, but I need to know, how I
I have a very basic question. I would like to know if here is
I realize that this is probably a very basic question, but I have spent

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.