473,396 Members | 1,784 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.

String Error "Lvalue required"......?

Getting string error on following code:

Expand|Select|Wrap|Line Numbers
  1. #include<stdio.h>
  2. #include<string.h>
  3. void main()
  4. {
  5. char name[20];
  6. name="Hello";
  7. printf("%s",name);
  8. getch();
  9. }
Mar 17 '13 #1
1 3107
sorry buddy
but c don't allow to put array declaration and array initialization separately.
so it should be
Expand|Select|Wrap|Line Numbers
  1. char name[20]="Hello";
Mar 17 '13 #2

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

Similar topics

3
by: Heiko Hund | last post by:
Hi, I do not understand the deeper reason for the following compiler error $ g++ test.cpp test.cpp: In function `int main()': test.cpp:41: error: `std::basic_string<char,...
4
by: J. Oliver | last post by:
I am attempting to copy a portion of a string into another string. Say I have "abcdef" in string 'a' and want to copy only "bcd" into a new string 'b'. The following function came to mind: ...
8
by: Tiago Costa | last post by:
I have a string that need to have the " char inside, but this give me an error: end of the sring, how can i make the " a char of the string? string comando = "OSQL -Usa -Psa -n -Q "BACKUP...
1
by: amitbadgi | last post by:
Welcome back amitbadgi | Logout | Faq Knowledge Discovery Keys COMPUTER PROGRAMMING, DATA MINING, STATISTICS, ARTIFICIAL INTELLIGENCE * Settings * Photos * Lists * MVPs * Forums * Blogs
1
by: james | last post by:
I am creating an connection string at runtime using decryption (crypto libraries). i have a very unpridictable error while assinging the generated connection string to the connection property. ...
1
by: Patrick.O.Ige | last post by:
Hi guys, I just moved a project from my pc to a server production (to an ISP). on my pc it all works fine with no errors. After fireing up the first page "default.aspx" i get the error...
4
by: Patrick.O.Ige | last post by:
I have this below in a Datalist:- <asp:HyperLink id="Hyperlink1" Cssclass="MenuUnselected" Text='<%# DataBinder.Eval(Container.DataItem, "cat_cities")%>' NavigateUrl='<%#...
5
by: Ron | last post by:
I think this code is almost working but I get the following error: Error 1 Cannot convert type 'string' to 'System.Xml.XmlAttribute' C: \Spring...
3
by: angi35 | last post by:
I'm having a zero-length string problem... Hoping someone can help. (This is in Access 2000.) In FormA, I have a button that opens FormB with OpenArgs. In FormB, the OpenArgs are translated into...
3
by: Scott | last post by:
I'm trying to capture all form elements posted on a page and concatenate them into a string for testing and to include in an email message. I'm getting the below error "Out of string space". I...
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...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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
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.