Mail Archives: djgpp/2003/02/12/00:45:07
Dear Sir,
I got the following errors(The file is at the bottom):
t1.cpp: In function `int main()':
t1.cpp:18: incompatible types in assignment of `const char[6]' to `char[101]'
t1.cpp:20:1: warning: no newline at end of file
How to give a string to an char array directly? Thanks a lot for your help.
Regards,
Y Chen
//t1.cpp
#include <stdlib.h>
#include <stdio.h>
#include <iostream.h>
#include <iomanip.h>
#include <new.h> // for memory error handling
//#include <ctype.h>
#include <unistd.h> // sleep
//#include <termios.h> // struct termios
#include <fcntl.h>
#include <sys/param.h>
#include <math.h>
#include <errno.h>
#include <string.h>
#include <time.h>
int main(){
char c[101];
c="5.dat";
return 0;
}
- Raw text -