how are the char, integer or float variables stores in memory struct{ int a; char b; int c; char d}; struct { int a; int b; char c; char d}; if we are making the variable of both structure and when I find the size of both member we get different while both have same data member, can you understand me ?

Asked by Last Modified  

4 Answers

Follow 0
Answer

Please enter your answer

MS SQL SERVER DBA Trainer

Data is stored in a computer's memory. The memory system comprises of uniquely numbered cells called memory addresses. We need to know the address where something is stored in order to retrieve it and work on it. A programming language frees us from keeping track of these memory addresses by substituting...
read more
Data is stored in a computer's memory. The memory system comprises of uniquely numbered cells called memory addresses. We need to know the address where something is stored in order to retrieve it and work on it. A programming language frees us from keeping track of these memory addresses by substituting names for them. These names are called variables. Variables are descriptive names for the memory addresses. read less
Comments

Experienced Tutor for B Tech,M Tech , MCA, BCA,MBA, Programming languages and Industrial Training

1,2,4 bytes
Comments

International Corporate Trainer For dotnet Core ,Angular 2 ,C ,C++ and LPT Marathi for RBI Banking

When variables are created in memory , there is a gap of same o. of bytes in between two variables , so you get difference between the size of these two structs.when two int variables are adjacent ,2 bytes space is a gap in between them. But when int and char then again int char is the sequence of declaration...
read more
When variables are created in memory , there is a gap of same o. of bytes in between two variables , so you get difference between the size of these two structs.when two int variables are adjacent ,2 bytes space is a gap in between them. But when int and char then again int char is the sequence of declaration 1 byte gap is between them. so you get size of above two struct as 16 and 12 bytes respectively. u can use pointer to display address of every variable and you can get exact idea of locations and size of struct. To learn in details u can contact me. and learn online. read less
Comments

B Pharm,M.S.

A stucture stores different datatypes of members in different addresses V/S union , there is an option in linker where you can set even and odd addressing scheme and default type of declaration i.e unsiged and signed ...this could make a difference
Comments

View 2 more Answers

Related Questions

I want know about the salaries we get by the jobs after doing MCA
It is fully based on your skills and ability.
Anusha
How much time is needed to prepare for all the papers (1 - 5sem) of IGNOU MCA?
when you doing MCA then require to clear one by one Semester with related Subjects.
Mohd
Please solved my following aswing mentioned question...
very easy question if you do SQL Development course then u can got all Answers.
Subhayan
0 0
8
How can I apply for the internship in MCA last Semester 6 month industrial project? Where I can search company giving stipend in Pune?
you can contact any company for training then you got some new ideas for intership...
Nitave
0 0
8
What are the best colleges in India to pursue MCA?
It's depends on test merit.
Rohit Nandwani

Now ask question in any of the 1000+ Categories, and get Answers from Tutors and Trainers on UrbanPro.com

Ask a Question

Related Lessons

Algorithms L1 (Introductory)
Why Algorithms?Modelling the Problem: Modeling is the art of formulating our application regarding precisely described, well-understood problems. Proper modelling is the key to applying algorithmic design...

Program Analysis
Persons working in the field of computer science analyze programs for correctness and to understand their efficiency for solving problems. Testing is the most obvious way to analyze correctness; although...

Basic Concepts Of Income Tax
Q: What is Tax ? Ans : It is an Amount which is payable by a person to the government so that govt can meet out of its certain expenses for which directly there are no charges. For Example: Defense,...

Computing in Context
A working knowledge of the major hardware and software components of computer systems is necessary for the study of computer science. These topics need not be covered in detail, but they should be addressed...

Program Implementation
To implement a program, a student must understand the fundamental programming constructs of the language, as well as the design of the program. Object-oriented development involves implementing the individual...

Recommended Articles

Master of Computer application is undoubtedly one of the most renowned degrees that many young students choose to study. This post-graduation program completed from a prestigious institute in India can open many scopes for young job seekers. In India, this course takes three years to cover. Candidates receiving this training...

Read full article >

So, Children your exams are fast approaching & you are facing the jitters? correct? But there is nothing to worry. If you plan your studies well, you can definitely pass your examinations with flying colours. Here are a few simple tips that you can follow: 1. Your school has issued a time table for the exams....

Read full article >

Students Preparing for Exams are always bogged by Revision to be completed and how much to Revise. I had found these Revision Techniques to be profound in actual getting good exams scores during my school days. Let us see what effective Revision Techniques can be used to improve Learning 1) If Time is King, an...

Read full article >

There are a number of exciting upcoming government jobs in India for you. Just check out the links and apply for relevant jobs. Open Positions: Position Name Dept./Org. Vacancies Last Date Info. Link LDC, Steno, Driver, MTS, Ayah, Cook IAF 140 30-03-2015 http://bit.ly/1C1zjAM Technician,...

Read full article >

Looking for MCA Coaching classes?

Learn from the Best Tutors on UrbanPro

Are you a Tutor or Training Institute?

Join UrbanPro Today to find students near you