• Register
Welcome to Kodlogs Q&A, programming questions and answer website.

Most popular tags

java program python php javascript android c# r spring c mysql arrays python-3 tomcat ggplot2 numpy exception spring-boot jdbc eclipse ssl sockets string x html sql-server python-2 7 java-8 intellij-idea entity-framework macos pandas minecraft ios hibernate csv security json windows ssl-certificate heap-memory scikit-learn winforms illegalstateexception keytool matlab redirect code program junit pip maven ubuntu math facebook jquery cryptography sql asp list loop int net class https fatal-error struts java-applet runtime-error apache-spark pyspark garbage-collection sql-server-2005 for-loop quirks-mode internet-explorer-9 internet-explorer machine-learning keras indentation-error unit-testing android-studio jupyter-notebook virtualenv webclient visual-studio-2010 webpack compiler-errors numpy-ndarray curl vagrant aspnet dataframe nullpointerexception javafx jsp django jpa docker wordpress servlet indentation xcode typeerror scanner sum deployment socketexception git linux loops css util oracle cmd recursion search tcp syntax connection float datetime httpwebrequest main function number import file html5 elasticsearch-5 elasticsearch app-transport-security ios10 ios9 cdn cloudflare wampserver plpgsql salt-stack sysv parent-child android-edittext textview visual-studio-2012 android-workmanager unique-index tsql unity2d unity3d electron theano maven-compiler-plugin pickle assetbundle rstudio bar-chart python-tesseract tomcat6 primefaces solr easymock jvm-crash tomcat7 apache-httpclient-4 web-services woodstox discord jersey-2 prepared-statement resultset sencha-cmd sencha-touch-2 sencha-touch powermock fips apex x509certificate ibm-bpm websphere-7 file-permissions file-io accesscontrolexception grizzly atmosphere slick2d lwjgl informetica twitter-bootstrap-3 jax-rs resteasy spring-mvc spring-security-kerberos spring-security kerberos long-integer mapnik pytorch git-review vpython continuation homebrew xgboost conda visual-studio android-asynctask stack-trace user-interface jaxws-maven-plugin maven-3 maven-2 browser-notsupportedexception google-maps-api-3 google-maps visual-studio-code truststore firebase-authentication aws-organizations amazon-web-services php-7 string-formatting cplusplus visual-studio-2015 net-core net-mvc msbuild extension-methods foreign-keys windows-services react-redux reactjs inputstream facebook-graph-api entity-framework-4 reportingservices-2005 reporting-services mips linear-regression anova deep-learning block-device melt reshape2 floating-point webpack-dev-server javascrip 0-lollipop android-5 statsmodels avx eclipseide javafx-2 php-not-recognized laravel command-line tinyurl classnotfoundexception atom-editor android-emulator android-sdk-tools ionic2 cordova foobar2k tcplistener net-2 net-4 ole-db-provider export-to-excel openrowset windows-10 vagrantfile glmnet jvm-arguments global-variables orm classformatexception eof upstart qt ipv4 graphviz pydot atom curses unityeditor pandoc tesseract xls oledb redux spotify cxf wamp nio stacked prediction headless hyperlink outlook jackson keystore applicationcontext pipeline iis jstl encryption perfect-square objective-c carthage xcode8 indexing standard-deviation sudo xampp postgresql connector apple mdf kubernetes destructor gettime arithmeticexception gmail ioexception heuristics milliseconds reporting disk cpu npm modx-revolution goldsky modx prevnext javascript-dictionary stack-smashing device-monitor radio-button android-actionbaractivity android-activity android-fragments java-long unqualified-id ora-12154 javc c++ java nullpointerexception runtime-error drjava awt-eventqueue dsx math-pow ajquery nosuchelementexception appcompatactivity jsf jtextfield awt jpanel inputmismatchexception glassfish deque jupyter flask lvalue tensorflow gradle servlets netbeans simulation ibm factorial javax apache boot opengl virtualbox jvm margins 2147483647 mongodb cloud firebase plot plugins github processor automation crash card certificate pointers concatenation formatting debugging devices module testing color arraylist node sequence date caching expected build response ip directory algorithms release collections print figure casting url expression integer microsoft sorting sort read types replace js rest ajax exe excel dictionary message required database text variable time size dll system files table runtime static random code web map http error version 0 2
0 votes
3 views
What is lvalue required as left operand of assignment in C ? What is L value required?

I get following error (error: lvalue required as left operand of assignment) :

void loop(){

 Serial.println("Test?");

 Serial.println("{1}area");

 [u][b]if (Serial.available() = 1){

[/b][/u]    serialData = Serial.read;

   switch(serialData){

     case 1: action1(); break;

     default: error(1); break;

   }

 }

}
by (1.5k points)  
reshown by

1 Answer

0 votes

look on Ivalue and Rvalue basically whenever we use an equal to operator for assigning a value in a constant or in a variable at that particular time we should take care how these  Ivalue means the value on the left hand side and this R value means the value on the right hand side is going on so basically for a successful assignment we should put the variable on the left hand side so as you can see here a is equal to 20 so this is the  I value and this one is the R value so in the  I value means on the left hand side we only have a variable while on the right hand side we can have a constant we can have a variable we can have an expression which is evaluating a value so ultimately the value will come on the left hand side so make sure it is a variable but if you are defining a constant at that particular time you can have the name of a constant on the left hand side but that is the only exception after the constant is defined even if the next next line you cannot place the constant identifier on the left hand side of the assignment as here you can see 10 and 20 both are constant figures so you cannot place the constant on the left hand side it will give you an error that is  I value required so as I said in the  I value means the left hand side will be an variable only so let's see practically how we should go for such assignment tasks so now as you can see here I have defined three variables like int a B and C so if I want to initialize them with a value on the left hand side as you can see I have placed a variable and along with the value on the right hand side so this one is a constant while this one is a variable again if I want the similar thing I can do that also again on the left hand side I have B which is while on the right hand side I have a constant figure but if I try to do something in Reverse like 200 is equal to B then this will be an invalid operation so as soon as I will compile this it will show me the error in this particular line that that is  I value required means on the left hand side I cannot place the constant rather it should be a variable similarly if I will say C is equal to a plus B again this is a valid operation because on the right hand side I can pass an expression I can pass any variable I can pass a constant value but on the left hand side it must be a variable which will take the value because if I'll talk about equals to it will assign the value from right-hand side to left hand side so even this one is a valid operation so if I'll try to print the value of C I will get the value of the total of a and B that is 101 plus 200 that is 301 so let's check it out and as soon as I execute this we will see three zero one as the output but now if I'll try to do something in Reverse like suppose a plus B is equal to C again that is going to be an invalid operation because it will see a l value required because on the right left hand side I cannot have any expression so as now we know . 

by (8.9k points)  
...