delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/1998/11/25/10:58:03

From: xiao AT cmold DOT com (Xiaomao Xiao)
Subject: (none)
25 Nov 1998 10:58:03 -0800 :
Message-ID: <199811242038.PAA17134.cygnus.gnu-win32@spencer.actech.com>
References: <199811232132 DOT WAA00238 AT dedalus DOT com>
Reply-To: xiao AT cmold DOT com
Mime-Version: 1.0 (generated by tm-edit 7.106)
To: Ugo Matrangolo <matra AT dedalus DOT com>
Cc: gnu-win32 AT cygnus DOT com

Hi there:

As for my undersding, it shouldn't work for FreeBSD either.  Your matrix from
vector is not initialized correctly.  Your declaration of 'vector<vector<int> >
mymatrix(n)' only allocated spaces for n vector<int>.  It doesn't say
vector<int> is an array of n integer.  This definitely will cause segmentation
error.

>>>>> "Ugo" == Ugo Matrangolo <matra AT dedalus DOT com> writes:

Ugo> Hi!.  I'm a new user of cyg-win32 . Today i tried to recompile some old c++
Ugo> code under cyg-win32 B20 under win98 . This program causes a segment
Ugo> violation :

Ugo> ----- cyg-bug.cc ----- #include <iostream.h> #include <vector>

Ugo> int main(void) { int n;

Ugo>    cout << "Gimme a dimension :"; cin >> n;

Ugo>    vector<vector<int> > mymatrix(n);

Ugo>    for (int i = 0;i < n;i++) for (int j = 0;j < n;j++) mymatrix[i][j] = 0;

Ugo>    return 0; }

Ugo> ---------------------

Ugo> This program works fine under FreeBSD.

Ugo> Can anyone tell me if it is a bug or my fault ?

Ugo> bye .


Ugo> - For help on using this list (especially unsubscribing), send a message to
Ugo> "gnu-win32-request AT cygnus DOT com" with one line of text: "help".


-- 

Xiaomao

=================================================================
Xiaomao (Mark) Xiao                  E-Mail: xiao AT cmold DOT com
C-MOLD                                  TEL: (607) 257-4949 x 699
31 Dutch Mill Road                      FAX: (607) 257-6355
Ithaca, NY 14850                        URL: http://www.cmold.com
=================================================================
-
For help on using this list (especially unsubscribing), send a message to
"gnu-win32-request AT cygnus DOT com" with one line of text: "help".

- Raw text -


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