public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* Help with #include <string.h>,,,
@ 2003-05-01  2:05 Jim Christiansen
  2003-05-01  2:58 ` Oscar Fuentes
  0 siblings, 1 reply; 2+ messages in thread
From: Jim Christiansen @ 2003-05-01  2:05 UTC (permalink / raw)
  To: gcc-help

Hello,

I'm a teacher that admins a 110 plus NT network who is trying to move 60 of
these boxes to Linux Thin Clients for all of our teaching.  I have been
successful for all of our Business and IT classes, but have a problem 
teaching
out of our C++ text from Lawernceville Press.

This book is a couple of years old and specically for MSVisual C++.My 
students have been using Anjuta for their HTML work, and I was excited that 
the programs from the text compiled and built in linux with anjuta.  Now, I 
have a problem with the #include <lvp\string.h> reference, and even if I 
change it to:

#include <string.h> or
#include <string>

the code fails to compile.I'ld be grateful for any pointer on getting this
simple program running using anjuta and linux.#include <iostream.h>#include
<lvp\string.h>int main()

My thin server is based on Redhat8.0

#include <iostream.h>
#include <lvp\string.h> // or #include <string> or #include <string.h>

int main()
{
  String Name = "LVPress";
  cout.width(7); cout << Name << endl;
  cout.width(9); cout << Name << endl;
  cout.width(11); cout << Name << endl;
  cout.width(13); cout << Name << endl;
  cout.width(11); cout << Name << endl;
  cout.width(9); cout << Name << endl;
  cout.width(7); cout << Name << endl;
  return(0);
}

Thanks for the help,

Jim

_________________________________________________________________
Add photos to your messages with MSN 8. Get 2 months FREE*.  
http://join.msn.com/?page=features/featuredemail

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

* Re: Help with #include <string.h>,,,
  2003-05-01  2:05 Help with #include <string.h>,,, Jim Christiansen
@ 2003-05-01  2:58 ` Oscar Fuentes
  0 siblings, 0 replies; 2+ messages in thread
From: Oscar Fuentes @ 2003-05-01  2:58 UTC (permalink / raw)
  To: gcc-help; +Cc: christiansen_j

"Jim Christiansen" <christiansen_j@hotmail.com> writes:

> Hello,
>
> I'm a teacher that admins a 110 plus NT network who is trying to move 60 of
> these boxes to Linux Thin Clients for all of our teaching.  I have been
> successful for all of our Business and IT classes, but have a problem
> teaching
> out of our C++ text from Lawernceville Press.
>
> This book is a couple of years old and specically for MSVisual C++.

This possibly means it explains how to program MSVC++, not C++. MSVC++
v6 implements a dialect of C++. Most sources written by "MSVC++ only"
people are not compilable by true C++ compilers. g++ is much more
compliant with the ISO standard.

> My students have been using Anjuta for their HTML work, and I was
> excited that the programs from the text compiled and built in linux
> with anjuta.  Now, I have a problem with the #include <lvp\string.h>
> reference, and even if I change it to:
>
> #include <string.h> or
> #include <string>
>
> the code fails to compile.I'ld be grateful for any pointer on getting this
> simple program running using anjuta and linux.#include <iostream.h>#include
> <lvp\string.h>int main()
>
> My thin server is based on Redhat8.0
>
> #include <iostream.h>
> #include <lvp\string.h> // or #include <string> or #include <string.h>

Have you tried #include "lvp/string.h" ?

(Observe slash orientation)

[snip]

I don't know what 'anjuta' is, but I hope this does what you want:

// Standard C++ Libray lives on headers without the .h suffix
#include <iostream>
#include <string>

int main()
{
  // Standard C++ Library names are on namespace 'std'
  // We inject 'cout' and 'end' on the current namespace to save
  // typing 'std::' lots of times
  using std::cout;
  using std::endl;
  
  std::string Name = "LVPress";
  cout.width(7); cout << Name << endl;
  cout.width(9); cout << Name << endl;
  cout.width(11); cout << Name << endl;
  cout.width(13); cout << Name << endl;
  cout.width(11); cout << Name << endl;
  cout.width(9); cout << Name << endl;
  cout.width(7); cout << Name << endl;

  return(0);
}

-- 
Oscar

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

end of thread, other threads:[~2003-05-01  2:58 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-05-01  2:05 Help with #include <string.h>,,, Jim Christiansen
2003-05-01  2:58 ` Oscar Fuentes

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).