[Dev-C++] char Array - DevC++ beginner...
Open Source C & C++ IDE for Windows
Brought to you by:
claplace
|
From: Aurea J. L. <jan...@ho...> - 2003-06-16 18:08:37
|
<html><div style='background-color:'><DIV>
<P>I am trying to create an array type char in Dev++ like this:</P>
<P><EM><FONT size=2>#include <iostream.h><BR>#include <stdlib.h><BR>#include <string></FONT></EM></P>
<P><EM><FONT size=2>int main()<BR>{<BR>char Name[];</FONT></EM></P>
<P><EM><FONT size=2>Name[1]="J";</FONT></EM></P>
<P><EM><FONT size=2>cout << sizeof(Name);</FONT></EM></P>
<P><EM><FONT size=2>system("PAUSE");<BR>return 0;<BR>}</FONT></EM></P>
<P>and DevC++ is telling me that <EM><FONT size=2>the array size is missing </FONT></EM>and that <FONT size=2><EM>assig to "char" from "const char" lacks a cast</EM>.</FONT></P>
<P>Anyone could please help me with what I am doing wrong?</P>
<P>Thanks.<BR></P>
<P>Janine</P></DIV></div><br clear=all><hr>Add photos to your messages with <a href="http://g.msn.com/8HMEENUS/2749??PS=">MSN 8. </a> Get 2 months FREE*.</html>
|