public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/31737]  New: Problem using <string> STL with g++ 3.4.6
@ 2007-04-28 17:47 leonardo dot anversi at gmail dot com
  2007-04-28 18:17 ` [Bug c++/31737] " pcarlini at suse dot de
  0 siblings, 1 reply; 2+ messages in thread
From: leonardo dot anversi at gmail dot com @ 2007-04-28 17:47 UTC (permalink / raw)
  To: gcc-bugs

Hi,

I must tried to run an program in g++3.4.6, and it gives an wrong answer.
This problem does not occur in g++ 2.95.
I am using debian etch.
Se the C++ code below:

////////////////////////////////////////////////////begin-code/////////
#include<iostream>
#include<string>
using namespace std;

int main(){

        int  n, nn; 
        string vector[54], word;

        cin >> nn;
        for (int i=0; i<nn; i++){
                cin >> word;                    
                for (int j=0; j<word.size(); j++){ vector[i][j] = word[j];}
        } 
        for (int k=0; k<nn; k++){                       
                for (int l=0; l<word.size(); l++){ cout << vector[k][l];}
                cout << endl;
        }
        return 0;
}
////////////////////////////////////////////////////end-code//////////////

As you can see, if you run the program and give any input, it gives you only
the last input.

But if you run with g++-2.95, there's no problem.


Thanks.


-- 
           Summary: Problem using <string> STL with g++ 3.4.6
           Product: gcc
           Version: 3.4.6
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: leonardo dot anversi at gmail dot com


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31737


^ permalink raw reply	[flat|nested] 2+ messages in thread

* [Bug c++/31737] Problem using <string> STL with g++ 3.4.6
  2007-04-28 17:47 [Bug c++/31737] New: Problem using <string> STL with g++ 3.4.6 leonardo dot anversi at gmail dot com
@ 2007-04-28 18:17 ` pcarlini at suse dot de
  0 siblings, 0 replies; 2+ messages in thread
From: pcarlini at suse dot de @ 2007-04-28 18:17 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from pcarlini at suse dot de  2007-04-28 19:16 -------


*** This bug has been marked as a duplicate of 31735 ***


-- 

pcarlini at suse dot de changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|                            |DUPLICATE


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31737


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2007-04-28 18:17 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-04-28 17:47 [Bug c++/31737] New: Problem using <string> STL with g++ 3.4.6 leonardo dot anversi at gmail dot com
2007-04-28 18:17 ` [Bug c++/31737] " pcarlini at suse dot de

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).