UrbanPro

Learn C Language from the Best Tutors

  • Affordable fees
  • 1-1 or Group class
  • Flexible Timings
  • Verified Tutors

Search in

Can an array be an lvalue?

Asked by Last Modified  

Follow 0
Answer

Please enter your answer

The answer to this question is no, because an array is composed of several separate array elements that cannot be treated as a whole for assignment purposes. The following statement is therefore illegal: int x, y; x = y; Additionally, you might want to copy the whole array all at once. You can do so...
read more
The answer to this question is no, because an array is composed of several separate array elements that cannot be treated as a whole for assignment purposes. The following statement is therefore illegal: int x[5], y[5]; x = y; Additionally, you might want to copy the whole array all at once. You can do so using a library function such as the memcpy() function, which is shown here: memcpy(x, y, sizeof(y)); read less
Comments

Experienced faculty in C with data structures and C++ with Data Structures,Linux Admin with Advance linux concepts

When an array is created starting or base address is stored in the array name i.e., array name is reduced to non-modifiable pointer. Therefore we can't overwrite or change address stored in the array name therefore array name can't appear in left side
Comments

Asst Professor

Hi Vinodha, L-Value stands for left value L-Value of Expressions refer to a memory locations In any assignment statement L-Value of Expression must be a container(i.e. must have ability to hold the data) Variable is the only container in C programming thus L Value must be any Variable. ...
read more
Hi Vinodha, L-Value stands for left value L-Value of Expressions refer to a memory locations In any assignment statement L-Value of Expression must be a container(i.e. must have ability to hold the data) Variable is the only container in C programming thus L Value must be any Variable. L Value Cannot be Constant,Function or any of the available data type in C. int main() { int num; 5 = num; //Error return(0); } read less
Comments

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

LValue is a container or the memory location in which data can be assigned (stored) using assignment statement. Array element can be lvalue ex A=5; here array element at position 1 is lvalue and 5 is rvalue means data value 5 is kept in container A
Comments

Software Professional Trainer with 26+ years of Experience in Software Design and Development

No. Because array contains more than one element. Array element can be lvalue.
Comments

C/C++/SQL/Datastructures/Database/Excel

When you say array, do you mean array name i.e. address, or array element. Yes, array element can be lvalue
Comments

Array elements can be lvalue, but array name itself is rvalue
Comments

Thanks for the question Vinodha, No because array is not an expression it is a collection of similar types of elements. Thanks, Team DishaaPro www.dishaapro.com
Comments

Experienced software professional, interested in teaching

In typical assignment statement, you will have "variable operator value" Here, the variable on the left hand side of the operator is also referred to as operand and must be a variable that can receive and hold the value. It should have pre-allocated memory to do so. If you write a statement where...
read more
In typical assignment statement, you will have "variable operator value" Here, the variable on the left hand side of the operator is also referred to as operand and must be a variable that can receive and hold the value. It should have pre-allocated memory to do so. If you write a statement where you used some constant or absolute value on the left hand side [for ex., 6=x;], compiler complains that it does not understand where it has to store the value, referring to the constant as lvalue read less
Comments

Experienced software professional, interested in teaching

If you refer the array by just using its name, you are referring to the beginning of the array using its address. If you are using the index along with the array name, you are referring to a specific array element. In first case, Array name can be used as lvalue, if you handle it as a pointer and use...
read more
If you refer the array by just using its name, you are referring to the beginning of the array using its address. If you are using the index along with the array name, you are referring to a specific array element. In first case, Array name can be used as lvalue, if you handle it as a pointer and use a '*. In second case, there is no issue in using it as lvalue, as long as you follow other rules like array is declared, index is valid and within range. read less
Comments

View 8 more Answers

Related Questions

How do you override a defined macro?
We can use the #ifdef and #undef directive to undefine a previously defined macro.
Sharmistha
What are the flaws of the C programming language?
C programming language does not support Object-oriented programming language
Sounak
0 0
7
What is the use of header files in C language?
In summary, header files in C serve as a means of organizing code, providing function prototypes and shared declarations, promoting modularity, and facilitating code reuse. They are essential in large...
Kamal
0 0
6
Is it valid to address one element beyond the end of an array?
No, array is a fixed size memory allocation for variables. It is illegal to access elements beyond the allocated space.
Shivani
what is syntex error
In computer science, a syntax error ( not Syntex ) is an error in the syntax of a sequence of characters or tokens that is intended to be written in a particular programming language. For compiled languages,...
Tanha

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

Ask a Question

Related Lessons

Programming Practice Technique
Any Programming Language required an Algorithm. Algorithm - It is the finite set of instructions in which each and every instruction has the meaning, instructions are not ambiguous and all the instructions...

Static and dynamic libraries
A library is a package of code that is meant to be reused by many programs. A static library (also known as an archive) consists of routines that are compiled and linked directly into your program. When...

C for Begginers
C is an procedure oriented programming language. For any begginer the word program is new. Program: Set of instructions to be followed by machine or computer. Instruction Examples: Arithmetic instruction...

Bit wise operators in C
Bit Wise Operators Bit Wise operators are manipulates of individual bits with in a word of memory. The bit wise operators can be divided in to three general category. One’s Complement...

What Are IT Industries Performance Metrics?
1. Outstanding Expectation: Eligible to get Promotion easily and good salary hike. Always preferrable to go abroad. 2. Exceed Expectation: Can get Promotion as per schedule of company with good salary...

Recommended Articles

Brilliant Academy is one of the reputed institutes for B.Tech tuition classes. This institute is specialised in delivering quality tuition classes for B.E, Engineering - all streams and Engineering diploma courses. Incorporated in 2012, Brillant Academy is a brainchild of Mr Jagadeesh. The main motto of the academy is to...

Read full article >

Lasya Infotech is a Hyderabad based IT training institute founded in 2016 by O Venkat. Believing in his innovation, passion and persistence and with a diverse blend of experience, he started his brainchild to deliver exemplary professional courses to aspiring candidates by honing their skills. Ever since the institute envisions...

Read full article >

Hadoop is a framework which has been developed for organizing and analysing big chunks of data for a business. Suppose you have a file larger than your system’s storage capacity and you can’t store it. Hadoop helps in storing bigger files than what could be stored on one particular server. You can therefore store very,...

Read full article >

Whether it was the Internet Era of 90s or the Big Data Era of today, Information Technology (IT) has given birth to several lucrative career options for many. Though there will not be a “significant" increase in demand for IT professionals in 2014 as compared to 2013, a “steady” demand for IT professionals is rest assured...

Read full article >

Looking for C Language Classes?

Learn from the Best Tutors on UrbanPro

Are you a Tutor or Training Institute?

Join UrbanPro Today to find students near you
X

Looking for C Language Classes?

The best tutors for C Language Classes are on UrbanPro

  • Select the best Tutor
  • Book & Attend a Free Demo
  • Pay and start Learning

Learn C Language with the Best Tutors

The best Tutors for C Language Classes are on UrbanPro

This website uses cookies

We use cookies to improve user experience. Choose what cookies you allow us to use. You can read more about our Cookie Policy in our Privacy Policy

Accept All
Decline All

UrbanPro.com is India's largest network of most trusted tutors and institutes. Over 55 lakh students rely on UrbanPro.com, to fulfill their learning requirements across 1,000+ categories. Using UrbanPro.com, parents, and students can compare multiple Tutors and Institutes and choose the one that best suits their requirements. More than 7.5 lakh verified Tutors and Institutes are helping millions of students every day and growing their tutoring business on UrbanPro.com. Whether you are looking for a tutor to learn mathematics, a German language trainer to brush up your German language skills or an institute to upgrade your IT skills, we have got the best selection of Tutors and Training Institutes for you. Read more