
I've been teaching myself C++ lately and have been compiling at home on a RH6.1 box which has libstdc++ 2.9.0 The tutorials I have been using say to include <iostream.h> and cin/cout for standard input/output. I'm back at work after leave and am continuing my learnings now compiling on FC3 with libstdc++ 3.4.2 which gives me warnings about using depreciated headers with iostream.h. So I do what it says and remove the .h. This kicks back errors telling me that 'cin/cout is undeclared in function xyz A bit of a google and I find a page which says to add 'std::' to the cin/cout. I do this and things compiles fine. However I can't seem to find any info as to whether I need to add this all the time using the later libraries, or whether there is something extra I need to add/include in the source files So to cut a long story short my question is: do I continue using std::cin/cout? Or is there something else I need to include? Cheers Jodi -- ------------------------------------------------------------------------------------------------- Jodi W. Anderson, Mr (BA, A+, MCP) - Computer Systems Consultant Waikato University Library - Computing Operations Group Ph: +64 7 838 4323 email: jodi(a)waikato.ac.nz "Right now I'm having amnesia and deja vu at the same time. I think I've forgotten this before." -----BEGIN PGP PUBLIC KEY BLOCK----- Version: GnuPG v1.2.4 (GNU/Linux) mQGiBEE7vXkRBADqdMs07cJuvCn02bG8FSR2iOW2V8M7KB0v5vnmkVI/DPsbbCxf dE23r/6ag1kYS8R8WvnYNUkjOoTKXslmLPFnq6+7Rp3K7g6X4dKyXknGThfai9KW kfdurINrR8FVKvIieidXNrAzl2ADquQ0WPtJCI1KbRb2kL3/tW6AumRS5wCg5fmM kW6Ml3RRfKGqSBRCOfVl7P0D/iCrQjXTskuT0mU/7ZJCQlP09PO5SDoe1vUX2tiB WlbmDnm4t46V1QATybUKM/V8J5rVOsigO/Nv/+9W8VC0KhBs8BR1lVT3jFy91pXr k9MhhjDjb6nhpeM771jdpOFYt+g+Lq/Q5MXKoAIxrEoycKM3JoI/yPwixoJWZlgx CdsvBADRnk/JAPNsWrjfCxLXcpE9b6x/pINncoCK+NKf16ONfw5ArkdFhJdWeJss nOvfEcBzY2RdJOJ5mQA8XnXoeGWrreT5TTUMsvoCF5/UJ1Zuuu0L8hOw0DKg9W0m QwbA7qkDZC9lMqCLmp6YreJydJAr2cp7U0p/d1Fpwd/lhH56LLQtSm9kaSBBbmRl cnNvbiAoV29yayBLZXkpIDxqb2RpQHdhaWthdG8uYWMubno+iF4EExECAB4FAkE7 vXkCGwMGCwkIBwMCAxUCAwMWAgECHgECF4AACgkQXzBud+/fPrsh2gCg4vHHtmbV R9rO8q5c+rbkAalwFmkAoJAAApKfPVHveqHJjVxNGfMXMlCAuQENBEE7vXsQBACf gUZY022ewIUzn3Zi4tcI7H2RXBEbYArtqXtuKdsMZm4N6TygINA4R5KsXF9xe3g7 VNioVVlgbA4h7L4xgt4TOjIxeZSEFuhQKAZ/isqGV9njeCJHhsX75jT0TcacQtNJ JST5IO70Ll6f1j8ZujZlNvUMz5lUTBIKR3XZ1+XlzwADBQQAg03LfdqvmDV1I9jD w7mNJfomW2FBE6Pt0h0oCocEecl4K86fySrjxzFoZW/NEcchvkWHG4Fd/Vr4fSRe aPfABzmFnJCN0YprOvv1cJHnckkSRpvGkHNmfcOH2mC+Tf/GGyi2n6wCe6bk/030 D/qYX3zBxR3SyHJvj5kRYBSt1ayISQQYEQIACQUCQTu9ewIbDAAKCRBfMG53798+ u7AWAKDhkU/ZlKYC+XkkHpAPs7Brf5c9PACgu9GBbiQW834G0lEHzEVYib1mgIM= =tr0I -----END PGP PUBLIC KEY BLOCK-----

On Wed, 2005-01-26 at 11:14, Jodi Anderson wrote:
I've been teaching myself C++ lately and have been compiling at home on a RH6.1 box which has libstdc++ 2.9.0 The tutorials I have been using say to include <iostream.h> and cin/cout for standard input/output. I'm back at work after leave and am continuing my learnings now compiling on FC3 with libstdc++ 3.4.2 which gives me warnings about using depreciated headers with iostream.h. So I do what it says and remove the .h. This kicks back errors telling me that 'cin/cout is undeclared in function xyz A bit of a google and I find a page which says to add 'std::' to the cin/cout. I do this and things compiles fine. However I can't seem to find any info as to whether I need to add this all the time using the later libraries, or whether there is something extra I need to add/include in the source files
So to cut a long story short my question is: do I continue using std::cin/cout? Or is there something else I need to include?
gcc/g++ 3 has got considerably tighter than the older 2.95 version used for ages. add using namespace std; at the top of your source files, and everything will 'default' to having a std:: prefix. John

Hihi, I'm working on a problem. I found buddy wearing ACM T-Shirt(World final, so cool!). So I post it here thinking maybe you can give me some hints. It's described as following: Given a string and a pool of strings, find which string in pool is best matched the given one. I know I can use dynamic programming to find out the largest common substring of two strings. But how to apply on my problem? GUO Zhijun jamguo(a)sh163.net

On Wed, Jan 26, 2005 at 07:37:02PM +0800, GUO Zhijun wrote:
Hihi,
I'm working on a problem. I found buddy wearing ACM T-Shirt(World final, so cool!). So I post it here thinking maybe you can give me some hints. It's described as following: Given a string and a pool of strings, find which string in pool is best matched the given one. I know I can use dynamic programming to find out the largest common substring of two strings.
But how to apply on my problem?
Hi, I've looked at something like this before in the past. The terms you want to look for are "string edit distance" or "Levenshtein" on a google search. Basically it gives a score for how many additions and deletions are required to turn one string into another. John

---------- Original Message ----------
I'm working on a problem. I found buddy wearing ACM T-Shirt(World final, so cool!). So I post it here thinking maybe you can give me some hints. It's described as following: Given a string and a pool of strings, find which string in pool is best matched the given one. I know I can use dynamic programming to find out the largest common substring of two strings.
But how to apply on my problem?
Hi, I've looked at something like this before in the past. The terms you want to look for are "string edit distance" or "Levenshtein" on a google search. Basically it gives a score for how many additions and deletions are required to turn one string into another.
The pool has ~2 million strings.... Each string should be around 1k in length. so I think comparing one by one is not a good method. Any opinion? Sincerely, GUO Zhijun jamguo(a)sh163.net

Jodi Anderson wrote:
I've been teaching myself C++ lately and have been compiling at home on a RH6.1 box which has libstdc++ 2.9.0
The WLUG library have a couple of recently donated C++ books, while quite old, are probably worth a read. Let me know if you'd like to join and read them. I seem to remember you work at the Uni library, so probably also have a source of literature. :) Craig

Thanks Craig & John . I figured it would be something simple like that. Yeah I do work at the Uni Library which is where I've got the book I'm using from - most aren't all that up-to-date tho. Have been considering joining the LUG - last couple of years were not good due to my wife's illness. However she is on the mend now so this year I might get the chance Cheers Jodi On Wed, 2005-01-26 at 11:25 +1300, Craig Box wrote:
Jodi Anderson wrote:
I've been teaching myself C++ lately and have been compiling at home on a RH6.1 box which has libstdc++ 2.9.0
The WLUG library have a couple of recently donated C++ books, while quite old, are probably worth a read.
Let me know if you'd like to join and read them. I seem to remember you work at the Uni library, so probably also have a source of literature. :)
Craig
_______________________________________________ wlug mailing list | wlug(a)list.waikato.ac.nz Unsubscribe: http://list.waikato.ac.nz/mailman/listinfo/wlug
-- ------------------------------------------------------------------------------------------------- Jodi W. Anderson, Mr (BA, A+, MCP) - Computer Systems Consultant Waikato University Library - Computing Operations Group Ph: +64 7 838 4323 email: jodi(a)waikato.ac.nz "Right now I'm having amnesia and deja vu at the same time. I think I've forgotten this before." -----BEGIN PGP PUBLIC KEY BLOCK----- Version: GnuPG v1.2.4 (GNU/Linux) mQGiBEE7vXkRBADqdMs07cJuvCn02bG8FSR2iOW2V8M7KB0v5vnmkVI/DPsbbCxf dE23r/6ag1kYS8R8WvnYNUkjOoTKXslmLPFnq6+7Rp3K7g6X4dKyXknGThfai9KW kfdurINrR8FVKvIieidXNrAzl2ADquQ0WPtJCI1KbRb2kL3/tW6AumRS5wCg5fmM kW6Ml3RRfKGqSBRCOfVl7P0D/iCrQjXTskuT0mU/7ZJCQlP09PO5SDoe1vUX2tiB WlbmDnm4t46V1QATybUKM/V8J5rVOsigO/Nv/+9W8VC0KhBs8BR1lVT3jFy91pXr k9MhhjDjb6nhpeM771jdpOFYt+g+Lq/Q5MXKoAIxrEoycKM3JoI/yPwixoJWZlgx CdsvBADRnk/JAPNsWrjfCxLXcpE9b6x/pINncoCK+NKf16ONfw5ArkdFhJdWeJss nOvfEcBzY2RdJOJ5mQA8XnXoeGWrreT5TTUMsvoCF5/UJ1Zuuu0L8hOw0DKg9W0m QwbA7qkDZC9lMqCLmp6YreJydJAr2cp7U0p/d1Fpwd/lhH56LLQtSm9kaSBBbmRl cnNvbiAoV29yayBLZXkpIDxqb2RpQHdhaWthdG8uYWMubno+iF4EExECAB4FAkE7 vXkCGwMGCwkIBwMCAxUCAwMWAgECHgECF4AACgkQXzBud+/fPrsh2gCg4vHHtmbV R9rO8q5c+rbkAalwFmkAoJAAApKfPVHveqHJjVxNGfMXMlCAuQENBEE7vXsQBACf gUZY022ewIUzn3Zi4tcI7H2RXBEbYArtqXtuKdsMZm4N6TygINA4R5KsXF9xe3g7 VNioVVlgbA4h7L4xgt4TOjIxeZSEFuhQKAZ/isqGV9njeCJHhsX75jT0TcacQtNJ JST5IO70Ll6f1j8ZujZlNvUMz5lUTBIKR3XZ1+XlzwADBQQAg03LfdqvmDV1I9jD w7mNJfomW2FBE6Pt0h0oCocEecl4K86fySrjxzFoZW/NEcchvkWHG4Fd/Vr4fSRe aPfABzmFnJCN0YprOvv1cJHnckkSRpvGkHNmfcOH2mC+Tf/GGyi2n6wCe6bk/030 D/qYX3zBxR3SyHJvj5kRYBSt1ayISQQYEQIACQUCQTu9ewIbDAAKCRBfMG53798+ u7AWAKDhkU/ZlKYC+XkkHpAPs7Brf5c9PACgu9GBbiQW834G0lEHzEVYib1mgIM= =tr0I -----END PGP PUBLIC KEY BLOCK-----
participants (4)
-
Craig Box
-
GUO Zhijun
-
Jodi Anderson
-
John R. McPherson