TIP: Click on subject to list as thread! ANSI
echo: c_plusplus
to: ALL
from: CHRISTIAN FELDE
date: 1998-01-22 17:06:00
subject: This work`s, but...

This program works, but it seams like when I give more the 3 char's in to 
array 2, I get this: "Segmentation fault (core dumped)"
Here's the source:
[start]
// chararray.cpp
#include 
void main()
{
        char array[2][10];
        cout << "Enter array 1: ";
        cin >> array[1];
        cout << "Enter array 2: ";
        cin >> array[2];
        cout << "Array 1: " << array[1] << endl;
        cout << "Array 2: " << array[2] << endl;
}
[eof]
and here's the error:
[start]
sco-systems:~/work/code$ chararray
Enter array 1: test1
Enter array 2: test2
Array 1: test1
Array 2: test2
Segmentation fault (core dumped)
sco-systems:~/work/code$
[eof]
Thanks for all help...
         __ __ __ __ _  _
        /_ // / // ///\//      email: scooby@applausenett.no
_ _ __ __//_ /_//_//_///    homepage: http://www.applausenett.no/~scooby/
--- BBBS/L v3.33 How
---------------
* Origin: Fluxpod Information eXchange, telnet://fix.no (2:210/30)

SOURCE: echomail via exec-pc

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.