|
From: Ioannis V. <iv...@at...> - 2003-05-14 20:43:44
|
I made a mistake. Fixed below:
-----Original Message-----
From: Ioannis Vranos [mailto:iv...@at...]
Sent: Wednesday, May 14, 2003 11:39 PM
To: 'dev...@li...'
Subject: RE: [Dev-C++] Isnt this a bug
-----Original Message-----
From: dev...@li...
[mailto:dev...@li...] On Behalf Of Luis Cortes
Sent: Wednesday, May 14, 2003 10:56 PM
To: dev...@li...
Subject: [Dev-C++] Isnt this a bug
#include <iostream>
#include <cstring>
#include <stdlib.h>
Or better: #include <cstdlib>
using namespace std;
int main(int argc, char *argv[])
{
char pcarray[15];
strcpy( pcarray, "hello world");
cout << pcarray << endl;
const char *cp = pcarray;
// shouldnt I get a compiler error here? Or is there a gcc switch that I
need to set??
No, it is valid. The name specifier of the built in array behaves like a
const char * const pointer, when used with pointers.
Ioannis Vranos
* Programming pages: http://www.noicys.freeurl.com
<http://www.noicys.freeurl.com/>
* Alternative URL 1: http://run.to/noicys
* Alternative URL 2: http://www.noicys.cjb.net
|