|
From: Kevin W. <ke...@me...> - 2001-12-07 21:55:26
|
From Kevin Wood ----------------------------
You can use
char MyValue[20]=3D{"Some text!"};
if you want to initialise the array on creation (you can't do this =
later).
Otherwise do
strcpy(MyValue, "Some text");
and make sure there is room in the array for all the characters plus the =
terminating null.=20
=20
----- Original Message -----=20
From: Exuss Draugas <dra...@ce...>
To: <Dev...@li...>
Sent: Friday, December 07, 2001 5:58 PM
Subject: [Dev-C++] Array of char
>=20
>=20
> Hi All!
>=20
> Just a simple question. How to assing a value to array of char?
> =20
> char myValue[20] =3D "Some text!";
> cout << myValue << endl;
>=20
> // This is don't work :((
> myValue=3D"New text";
> =20
> Works only: cin >> myValue;
>=20
> Thanks,
>=20
> Exuss
>=20
>=20
>=20
>=20
>=20
>=20
> --
> Nemokama el.pa=F0to d=EB=FEut=EB - http://webmail.delfi.lt/
>=20
> _______________________________________________
> Dev-cpp-users mailing list
> Dev...@li...
> https://lists.sourceforge.net/lists/listinfo/dev-cpp-users
>=20
|