Thread View: att.lang.c++
4 messages
4 total messages
Started by Srinivas Junnuru
Wed, 20 Jan 1999 00:00
Help: problems using cin and cout
Author: Srinivas Junnuru
Date: Wed, 20 Jan 1999 00:00
Date: Wed, 20 Jan 1999 00:00
12 lines
995 bytes
995 bytes
Can some one tell me what are all the libraries needed for using cin and cout?? I am getting segmentation violation at run time if I use cin and cout.. Also, what are all the libraries available for streaming?? Thanks a bunch. -Srini -- (Srinivas Junnuru) Note: Pl. remove NOSPAM from my address to e-mail me.
Re: Help: problems using cin and cout
Author: Martijn Lievaart
Date: Wed, 20 Jan 1999 00:00
Date: Wed, 20 Jan 1999 00:00
18 lines
1239 bytes
1239 bytes
Srinivas Junnuru wrote in message <784487$cvu$1@news.mr.net>... > Can some one tell me what are all the libraries needed for using cin and > cout?? I am getting segmentation violation at run time if I use cin and > cout.. Also, what are all the libraries available for streaming?? > If your program links, you have all libraries correct. If it crashes at runtime, you made an error in your program. I have a good guess what it is, but I'll have to see your source code first to know for sure. I'm not sure what you mean by "all the libraries available for streaming". HTH, Martijn -- My reply-to address is intentionally set to /dev/null reply to mlievaart at orion in nl
Re: Help: problems using cin and cout
Author: Srinivas Junnuru
Date: Wed, 20 Jan 1999 00:00
Date: Wed, 20 Jan 1999 00:00
47 lines
2283 bytes
2283 bytes
Thanks for the reply. The situation is: A main Cobol85 program calls a C++ function (say CPPFUNC). What all CPPFUNC has is two cout and one cin statements. When I link and run the cobol program, I can see that it first gets into the cobol program (as I have some display statements in it) and then it goes into CPPFUNC.. As soon as it hits the cout and cin statements I get a segmentation violation... There is nothing fancy in this CPPFUNC... Now, if I replace the cin and cout with scanf and printf statements, the program works great!!! So, what am I missing here??? FYI, I am working on HP-UX, using HP aCC and Cobol85 compilers. Thanks in advance. -Srini -- (Srinivas Junnuru) Note: Pl. remove NOSPAM from my address to e-mail me. Martijn Lievaart wrote in message <78502s$7ue@news3.euro.net>... >Srinivas Junnuru wrote in message <784487$cvu$1@news.mr.net>... >> Can some one tell me what are all the libraries needed for using cin and >> cout?? I am getting segmentation violation at run time if I use cin and >> cout.. Also, what are all the libraries available for streaming?? >> > > >If your program links, you have all libraries correct. If it crashes at >runtime, you made an error in your program. I have a good guess what it is, >but I'll have to see your source code first to know for sure. > >I'm not sure what you mean by "all the libraries available for streaming". > >HTH, >Martijn >-- >My reply-to address is intentionally set to /dev/null >reply to mlievaart at orion in nl > > > >
Re: Help: problems using cin and cout
Author: Jim Gewin
Date: Thu, 21 Jan 1999 00:00
Date: Thu, 21 Jan 1999 00:00
54 lines
2649 bytes
2649 bytes
Here's a guess: Since cout and cin are namespace scoped objects, they have to be initialized before being used. I'll bet the compiler depends on some C++ run-time code being linked in and executed before main, but Cobol doesn't know this, and so they are never constructed. Srinivas Junnuru wrote: > > Thanks for the reply. > > The situation is: A main Cobol85 program calls a C++ function (say CPPFUNC). > What all CPPFUNC has is two cout and one cin statements. > When I link and run the cobol program, I can see that it first gets into the > cobol program (as I have some display statements in it) and then it goes > into CPPFUNC.. As soon as it hits the cout and cin statements I get a > segmentation violation... There is nothing fancy in this CPPFUNC... Now, if > I replace the cin and cout with scanf and printf statements, the program > works great!!! So, what am I missing here??? > > FYI, I am working on HP-UX, using HP aCC and Cobol85 compilers. > > Thanks in advance. > > -Srini > > -- > > (Srinivas Junnuru) > Note: Pl. remove NOSPAM from my address to e-mail me. > > Martijn Lievaart wrote in message <78502s$7ue@news3.euro.net>... > >Srinivas Junnuru wrote in message <784487$cvu$1@news.mr.net>... > >> Can some one tell me what are all the libraries needed for using cin and > >> cout?? I am getting segmentation violation at run time if I use cin and > >> cout.. Also, what are all the libraries available for streaming?? > >> > > > > > >If your program links, you have all libraries correct. If it crashes at > >runtime, you made an error in your program. I have a good guess what it is, > >but I'll have to see your source code first to know for sure. > > > >I'm not sure what you mean by "all the libraries available for streaming". > > > >HTH, > >Martijn > >-- > >My reply-to address is intentionally set to /dev/null > >reply to mlievaart at orion in nl > > > > > > > >
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads