473,396 Members | 1,894 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

lvalue error

in this program
#include<iostream.h>
#include<conio.h>
void main
{
char c;
c=="success";
getch();
}
here, i got lvalue error in c=="success"
Jan 22 '12 #1
5 1588
donbock
2,426 Expert 2GB
  1. Are you sure you want == instead of =?
  2. c is a character and "success" is a string.
Jan 23 '12 #2
Here some codes to sharpen your Algorithm ->

Expand|Select|Wrap|Line Numbers
  1. #include<iostream.h>
  2. #include<windows>
  3.  
  4. int main()
  5. {
  6. int i;
  7. char c[1];
  8. cout << "Insert String's Length [number ] : ";
  9. cin >> i;
  10.  
  11. c[1] = c[i];
  12. cout << "Insert a string : ";
  13. cin >> c;
  14. cout << c;
  15.  
  16. cout << "\n\n";
  17. system ("pause");
  18. }
Jan 26 '12 #3
i think that it will give an lvalue error and it may give u lack cast error becoz it`s string and u r assigning it to just character rather then array of characters....
Jan 26 '12 #4
sumera
2
@Rashi Verma
....its because the main function misses paranthesis
Jan 30 '12 #5
sumera
2
its because main func misses () and a string is being assigned to a char
Jan 30 '12 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

19
by: Hongzheng Wang | last post by:
In K&R, they said: An object is a named region of storage; an lvalue is an expression refer to an object. How about these concept in C++? `The C++ Programming Language' has a similar...
7
by: Matthew Del Buono | last post by:
Don't try to solve the problem. I've found a way -- around or fixing it. I'm just curious as to whether this is Microsoft's problem in their compiler or if there's a standard saying this is to be...
24
by: Romeo Colacitti | last post by:
Hi, Does anyone here have a strong understanding for the meanings of the terms "lvalue" and "rvalue" as it pertains to C, objects, and different contexts? If so please share. I've been...
12
by: RoSsIaCrIiLoIA | last post by:
On Mon, 07 Feb 2005 21:28:30 GMT, Keith Thompson <kst-u@mib.org> wrote: >"Romeo Colacitti" <wwromeo@gmail.com> writes: >> Chris Torek wrote: >>> In article <4205BD5C.6DC8@mindspring.com> >>>...
9
by: tkrogc | last post by:
I compiled the source below using the comeau compiler http://www.comeaucomputing.com/tryitout/ Why does the f funtion compile while the g function produces an lvalue error ? (I thought the two...
14
by: Akhil | last post by:
plz c d following code #include<stdio.h> void main() { int x=4,y=1; y=x++++; //gives error message lvalue required y=x++ + ++y;//no errors
1
by: anupam | last post by:
Can anybody please tell me what is #pragma once and why compiler gives "lvalue requirement" errors :confused:
9
by: fperri | last post by:
I'm just learning C, and I'm trying to get this simple program to validate the user's entry making sure that they entered a number. I compile and I get this: Miracle C Compiler (r3.2), written...
1
by: binita | last post by:
hi how to overcome the lvalue error??
1
by: yyhkitty | last post by:
Hi, I keep getting two invalid lvalue in assignment errors. here's what my code looks like: pthread_t msg_receive(char *sbuffer, int *maxlen) { // get the values for sbuffer and maxlen ...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.