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 are security issues in the C language?
Even though the C language is widely used in different systems still it has many security flaws associated with it. This article focuses on discussing security vulnerabilities in the C language. Mainly...
Avinesh
0 0
7
How do we print something, e.g. my name, in C language without using the printf function?
int main() { char str1; char str1; strcpy (str1,"tutorialspoint"); strcpy (str1,"compileonline"); puts(str1); puts(str1); return (0); } Compile and run the above program to produce the following result tutorialspoint compileonline
Praveen
0 0
6
How to enable or disable USB using C program?
Already given answer kindy see in my back command.
Arindom M.
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 structure of a C program?
It typically consists of sections such as preprocessor directives, global variable declarations, function prototypes, the main function, and user-defined functions. A clear structure ensures logical flow,...
Snehal
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

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

What is Safety-Critical Software?
A software whose failure may cause death or injuries to the users called Safety-Critical Software.The software present as part of Aeroplanes, or present in Rail as railway signalling software or Automotive...

Basic Concepts of Web Designing
An introduction to domain names, web servers, and website hosting 1)What is the web? In a nutshell, the web is a whole bunch of interconnected computers talking to one another. The computers (on the...

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

Design your own Mouse Driver in C Language
Mouse Driver (msdrv.h) #include #include union REGS i,o; restrictmouseptr(int x1, int y1, int x2, int y2) { i.x.ax=7; i.x.cx=x1; i.x.dx=x2; ...

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