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 and where do I start learning C programming?
Goals Fundamental concepts of C programming language. Write your first C program. Understand different keywords & Data types in C. Understand Variables & Scope of Variables. Learn Enumeration or Enum...
Krishna
0 0
5
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
Is it necessary to learn data structures in C language only?
data structure helpful to improve your coding stability
Vikas
0 0
8
Why are operating systems written in C? Why aren't other languages used?
C is commonly used for developing operating systems due to its low-level capabilities, efficiency, and direct access to hardware. Its minimalistic design allows for better control over system resources,...
Deepa
0 0
7

Program to accept a list of elements and find the maximum number in the list. 

 

The logic will be 1. Create an array of the desired type 2. Sort the array in the descending order 3. Fetch the first elemnet from the array, this will be the maximum element in that array. Now use...
Lavanya
0 0
8

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

Ask a Question

Related Lessons

Be prepared to get trained--init
Before starting the training,students must be mentally prepared for acceptance of new knowledge. Students must attend training with open minded forgetting the position they are working.This will help...
S

Smartnub Softsolutions

0 0
0

Basics Of C And C++
C++ is powerful, highly flexible, and adaptable programming language that allows software engineers to organise and process information quickly and effectively. But this high-level language is relatively...

Creating First Program Using C Language
Step 1: Install and setup Turbo C compiler on your computer. Step 2: Open Turbo C from your Desktop or Programs menu. Select “File” from menu bar and select option “New”. Step...

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 Program-Error Handling
//Header files #include<stdio.h>#include<conio.h>#include<stdlib.h> //Main function void main(){ int dividend=10; int divisor=0; int quotient; //Function for clearing screen clrscr(); ...
S

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