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

I would like to know how we can use two dimensional arrays in strings? I would also know whether we can compare two dimensional strings?
// Two-dimensional array. int array2D = new int { { 1, 2 }, { 3, 4 }, { 5, 6 }, { 7, 8 } }; // The same array with dimensions specified. int array2Da = new int { { 1, 2 }, { 3, 4 }, { 5, 6 }, { 7,...
Harsha
Is C language the base for learning C++?
No. C and C++ are two different languages. All most all modern languages are influenced by C language. But we can learn C++ directly without learning C language.
Swathi
0 0
8
Who founded the C language? Why?
The C programming language was developed by Dennis Ritchie at Bell Labs in the early 1970s. Ritchie, along with Ken Thompson, created C as an evolution of the B programming language, aiming to enhance...
Santosini
0 0
7
Which websites are best to learn C programming?
There are several reputable websites where you can learn C programming. Here are some popular ones: GeeksforGeeks (geeksforgeeks.org): Offers a wide range of tutorials, practice problems, and articles...
Sarath Chandra
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

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...

Tress And Its Traversal
Depth First Traversals:(a) Inorder (Left, Root, Right) : 4 2 5 1 3(b) Preorder (Root, Left, Right) : 1 2 4 5 3(c) Postorder (Left, Right, Root) : 4 5 2 3 1 Trees are one of the data structures like...

C Program-Error Handling[Program Exit Status]
//Header files #include<stdio.h>#include<conio.h>#include<stdlib.h> //Main Function void main(){ int dividend=20; int divisor=5; int quotient; //Function for clearing screen clrscr();...
S

Is It Fine To Write “void main()” Or “main()” In C/C++?
The definition: void main() { /* ... */ } Is not and never has been C++, nor has it even been C. See the ISO C++ standard 3.6.1 or the ISO C standard 5.1.2.2.1. A conforming...

Tips of learning Java Language/Other Programming Languages
1.You should know the basic concept: If we talk about programming languages so basic concept are same in all the high level languages. So you should know the basic concept firstly then you can easily understand...
I

ICreative Solution

0 0
0

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