delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2003/02/12/15:15:07

From: "J. L." <jlsgarrido AT hotmail DOT com>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: char in c++
Date: Wed, 12 Feb 2003 14:00:35 -0600
Lines: 49
Message-ID: <b2e96h$1b185j$1@ID-143309.news.dfncis.de>
References: <200302120543 DOT h1C5hxC5015358 AT chac DOT its DOT uow DOT edu DOT au>
NNTP-Posting-Host: 200.34.143.30
X-Trace: fu-berlin.de 1045080085 45129907 200.34.143.30 (16 [143309])
X-Newsreader: Microsoft Outlook Express 5.50.4807.1700
X-MIMEOLE: Produced By Microsoft MimeOLE V5.50.4807.1700
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

"Y Chen" <yc12 AT uow DOT edu DOT au> escribió en el mensaje
news:200302120543 DOT h1C5hxC5015358 AT chac DOT its DOT uow DOT edu DOT au...
> 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>

After looking in yours posts, I have some questions.

1. There are a *good* reason for include this bunch of header files?

2. Are you programming in C, in C++, or in the mythical beast C/C++?

3. What version of GCC/DJGPP are you using?

4. What is your tutorial/book? In C++, if the version of GCC is >= 3.0, the
RIGHT WAY is #include <iostream>

J. L.



- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019