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

What is = and == in C language?
= is assignment operator while ==is comparision operator
Sayed
0 0
6
What are the __DATE__ and __TIME__ preprocessor commands?
The standard predefined macros are specified by the relevant language standards, so they are available with all compilers that implement those standards. Older compilers may not provide all of them. Their...
Subhasish
What is the use of getch(); in the end of c program
getch() is used to hold the console(output) window on the screen after the whole program run is completed till the user enters a key from keyboard. However, the character entered is not displayed on screen....
Priyanka
Can the last case of a switch statement skip including the break?
Last case if a switch should be DEFAULT.. Good to have this case always. Executed only when there's no other matching cases found.
Sanjeev
How can I improve my C language skills so that if anyone asks me any questions about C, I can have the answer to those particular questions?
There are types of questions asked in this sector. 1.Related to Syntax and theoretical. For this you have to have a sound knowledge of the language. 2.Related to programming and output's. For this...
Furqankhan
0 0
5

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

Ask a Question

Related Lessons

C++ Program-Working with constant using #define preprocessor
//Header Files #include#include // using #define preprocessor for defining a constant#define len 10#define br 5#define rad 3#define NEWLINE '\n' //Main function void main(){ int area_r; float area_c; //Function...

Introduction to Programming Languages
What is a Programming Language? A programming language is a formal computer language or constructed language designed to communicate instructions to a machine, particularly a computer. Programming languages...

Storage classes in c
Storage classes determine the scope and life time of a variable. Scope is defined as the region over which the defined variable is accessible. Lifetime is the time during which the value of a variable...

C Program-Upper Case Demo
/*WAP to print the character entered by user in upper case*/ //Header files #include<stdio.h>#include<conio.h> //Main function void main(){ char ch; //Function for clearing screen clrscr(); ...

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

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 >

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 >

Microsoft Excel is an electronic spreadsheet tool which is commonly used for financial and statistical data processing. It has been developed by Microsoft and forms a major component of the widely used Microsoft Office. From individual users to the top IT companies, Excel is used worldwide. Excel is one of the most important...

Read full article >

Software Development has been one of the most popular career trends since years. The reason behind this is the fact that software are being used almost everywhere today.  In all of our lives, from the morning’s alarm clock to the coffee maker, car, mobile phone, computer, ATM and in almost everything we use in our daily...

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