Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 28 Dec 2013 00:39:54 -0800
From:      Alfred Perlstein <bright@mu.org>
To:        Joe Nosay <superbisquit@gmail.com>,  FreeBSD Hackers <freebsd-hackers@freebsd.org>
Subject:   Re: template example
Message-ID:  <52BE8E5A.40807@mu.org>
In-Reply-To: <CA%2BWntOv-jWRUkZ6jqg3DLrt-RTAAGMtKb5FJC6A6rZ1bsk213Q@mail.gmail.com>
References:  <CA%2BWntOv-jWRUkZ6jqg3DLrt-RTAAGMtKb5FJC6A6rZ1bsk213Q@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On 12/27/13 7:41 PM, Joe Nosay wrote:
> I need a working example of C and C++ that will run using clang. I have to
> go head first into code and I learn by using an example, replacing
> variables, and then running. The standard "Hello World!" doesn't seem to
> work. What I would like to do is run commands from within the file.
> _______________________________________________
> freebsd-hackers@freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
> To unsubscribe, send any mail to "freebsd-hackers-unsubscribe@freebsd.org"
>
#include <iostream>

#include <stdlib.h>

int
main(int Argc, char **Argv)
{
     int rv;

     rv = system("echo hello world");
     std::cout << "return status from system call is: " << rv << std::endl;
     return (rv);
}

?

-- 
Alfred Perlstein




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?52BE8E5A.40807>