On Mon, Dec 23, 2013 at 10:36:25AM -0500, Karl Dahlke wrote:
> It is reassuring, and unsettling, that you can mix C and C++.
> Here is a little program that is a mix of both, yet it compiles and runs fine.
>
> --------------------------------------------------
> #include <iostream>
> #include <string>
> #include <stdio.h>
>
> using namespace std;
>
> void duplicate( int& a, int& b)
> {
> a *= 2;
> b *= 2;
> }
>
> int main()
> {
> string s;
> getline(cin, s);
> cout << s << endl;
> int x = 6, y(7);
> duplicate(x, y);
> printf("%d,%d\n", x, y);
> }
> --------------------------------------------------
Slightly pedantic note about this, in c++ you *should* really use
#include <cstdio>
Rather than
#include <stdio.h>
You could also use
cin >> s;
Instead of
getline(cin, s);
For added c++-ness (due to stream operators).
>
> The point for us is that jsdom.c and jsdom.cpp
> might not have to be very different at all,
> since most of the c should carry along.
> Maybe we can get lucky and just change the calls to the js engine.
Hopefully, that and a few datatype changes.
Cheers,
Adam.
_______________________________________________
Edbrowse-dev mailing list
[email protected]
http://lists.the-brannons.com/mailman/listinfo/edbrowse-dev