template example

Matthew Fleming mdf at FreeBSD.org
Sun Dec 29 17:22:09 UTC 2013


On Sun, Dec 29, 2013 at 9:11 AM, Joe Nosay <superbisquit at gmail.com> wrote:

> On Sat, Dec 28, 2013 at 10:44 PM, Joe Nosay <superbisquit at gmail.com>
> wrote:
>
> >
> >
> >
> > On Sat, Dec 28, 2013 at 3:52 AM, Tim Kientzle <tim at kientzle.com> wrote:
> >
> >>
> >> On Dec 27, 2013, at 7:41 PM, Joe Nosay <superbisquit at gmail.com> wrote:
> >>
> >> > The standard "Hello World!" doesn't seem to work.
> >>
> >> Which one?   Share the program you’re trying to compile and what errors
> >> you’re seeing.
> >>
> >> Tim
> >>
> >>
> >>
> >
> > Thanks @Alfred_Perlstein it worked with that example using clang
> > -fsyntax-only h.cpp
> >
> > a.out is the file.
> >
> >
> Trying a different approach with :::
> #include <iostream>
>
> #include <stdlib.h>
>
> int
> main(int Argc, char **Argv)
> {
>     int rv;
>
>     rv = system("echo 'ls /tmp' " && " echo  blee bble blle ");
>

If this is exactly what you compiled, that's the equivalent of:

    rv = system(1);

The two strings count as "true" and && is logical and.  I'd expect this to
crash when running.  Maybe you meant:

    rv = system("echo 'ls /tmp' && echo blee bble blle");

Cheers,
matthew


More information about the freebsd-hackers mailing list