473,396 Members | 2,010 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.

how to correct this error here the code is given below. "Lvalue required"

Expand|Select|Wrap|Line Numbers
  1. void main()
  2. {
  3. char a, *b, c[3];
  4. a= 0xaa;
  5. b = &a;
  6. c[0]= a;
  7. c[9] = *b + 10;
  8. c[1] = *(c+9)++;
  9. *c = *b--;
  10. printf(“%s\n”,c);
  11. }
Jan 21 '12 #1
1 1524
Banfa
9,065 Expert Mod 8TB
Line 8: (c+9) is a pointer and you can't apply the increment operator to a pointer. Did you mean (*(c+9)++?

Among other errors in your program

1. Line 1: main returns int not void
2. Line 4: 0xaa is greater than the value you can store in a signed char
3. Line 7: c[9] is out of range for the array c which only has a size of 3 and therefore valid indexes 0, 1, 2
Jan 23 '12 #2

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

Similar topics

29
by: DraguVaso | last post by:
Hi, I'm having this error in a VB.NET-application at the moment that I attempt to read data from an SQL Server: The .Net Data SQL Provider (System.Data.SqlClient) requires Microsoft Data...
2
by: Dave Hammond | last post by:
I've got what should be a simple assignment of either an element value or a default string to a variable, but when the element doesn't exist I get an "Object required" error rather than an...
2
by: chacquard | last post by:
Hi, I've been working on a form that contains a subform. The fields in the main form are EvendId, EventName, Date, time, place, etc.. These fields cannot be edited (locked = yes and...
5
by: Brent | last post by:
This AJAX stuff is all new to me. To try it out, I borrowed this code from a website: ======================== var http_request = false; function makeRequest(url) { http_request = false;
2
by: carl.reimann | last post by:
In using a simple smtp routine: # begin example >>> import smtplib >>> server = smtplib.SMTP('outgoing.verizon.net') >>> server.sendmail('my@address.net', 'another@address.net', """To:...
5
by: DaFallus | last post by:
I'm trying to write a somewhat simple page with dependent drop-down boxes. Unfortunately the entire page is written through PL/SQL so that makes it even more difficult for me to trouble shoot. I...
4
by: Phil | last post by:
Hi, This code gives an javascript error: "Object required" and never let see the Alert window. in code-behind: Protected Sub Button1_Click(ByVal sender As Object, ByVal e As...
6
by: BlackMustard | last post by:
hi all, i get a run-time error '424': Object Required on the last line below, and i can't figure out why... Dim adoConn As New ADODB.Connection Dim adoCmd As New ADODB.Command Dim...
6
by: Anette | last post by:
Hi, When I load pages through the db, e.g.: ovrigt.php?typ=disco and after that go to the menu I get an error message from IE6: "Object required" (translated from swedish IE). Part of menu: <div...
10
by: andersond | last post by:
On a webpage that has a variety of questions I get an "object required" error on lines like this... document.getElementById('tableQuestion17').style.visibility="visible"; This is the code...
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
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.