473,399 Members | 3,603 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,399 software developers and data experts.

Lvalue Required For Function Main

Hello Experts !!

I actually am wanting to practice on a 2 dimension char array. so, I am using the below program and getting the error - Lvalue Required For Function Main

#include <stdio.h>
#include <conio.h>
#include <string.h>

char varStringArray[1][5];

int main(void)
{
clrscr();
varStringArray[0] = 'a';
printf("%c", varStringArray[0]);
return 0;
}

Please help.
Sep 5 '14 #1
2 1716
donbock
2,426 Expert 2GB
Refer to Arrays Revealed. You define varStringArray with two dimensions, but then you only access it with one array index. The referenced article explains why this is a problem.

However, I would have expected a different error message. There may be something else wrong with your code that I don't see.
Sep 6 '14 #2
weaknessforcats
9,208 Expert Mod 8TB
Rather than duplicate the explanation, please read this: http://bytes.com/topic/c/insights/77...rrays-revealed.

Then if you still have a question about this, post again and we'll go from there.
Sep 6 '14 #3

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

Similar topics

5
by: Sai Krishna M | last post by:
Lvalue Required......Why? Hello all, the following code is not compiling in Turbo C and the error is "Lvalue Required" . main() {
13
by: wessoo | last post by:
Hi All. What is The Lvalue Required error message. (What does it mean?Is it an abbreviationof something.) I wrote this test program and I am keeping geting this message. void main() {...
8
by: Rody Reulen | last post by:
I made an console application with Visual Basic .net. Visual Basic will automatically create the sub procedure main for you. I try to convert the main procedure to a function. During the...
1
by: joe10001 | last post by:
Hi all, I just installed CRELoaded (oscommerce fork) on my server and all work fine except that I have a little message at the bottom of the main page : Fatal error: main() : Security alert:...
4
by: huggsy | last post by:
I started using C just today and I am having a problem with strrev() function. Here are my codes: #include<stdio.h> #include<conio.h> #include<string.h> main()
4
by: ramesh nambiar reloaded | last post by:
#include<stdio.h> #include<string.h> #include<conio.h> #include<dos.h> // #include<object.h> const char *hex = "0123456789ABCDEF"; char *bin2hex(char *string); int...
2
by: ehab mohamed | last post by:
When i try to run this program it give me a message that Lvalue required in function main. What is the cause?
0
by: pecca | last post by:
this is sample of my program #include<iostream.h> #include<conio.h> #define n 5 int total(int number); int average(int average, int total); void min_max(int number,int &min,int &max); void...
1
by: DavidSS | last post by:
Okay, I have a problem. I just started programming, and made my first "calculator" I then started making it more advanced, so it wouldn't crash if you tried to divide by 0. Then I wanted to make...
1
by: tuga kariem | last post by:
#include<iostream.h> main() { float a; cout<<--a++; } What does it mean by error no name eo2.cpp 6 :lvalue required in function main
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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
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.