gets() fgets() with subdivide.c tilepack.c squarect.cI am looking to use Ken Stephenson's CirclePack program
(http://www.math.utk.edu/~kens/) with some tiling programs written by
Cannon, Floyd, Parry. The programs I want to use are subdivide.c
tilepack.c squarect.c . They are available from
http://www.math.vt.edu/people/floyd/research/software/subdiv.html.
I tried compiling them on my Redhat 9 box, eg cc subdivide.c. When I do
so I get errors like "In function `Readtilingforvertex':
: the `gets' function is dangerous and should not be used."
I checked the FAQ and is says gets() is BAD and I should use fgets()
instead....
C++ has Boost libraries, C?Hello,
is there any library for C as Boost is for C++?
thanks in advance,
g said:
> Hello,
>
> is there any library for C as Boost is for C++?
There are lots of libraries available with C bindings. What functionality
are you after?
--
Richard Heathfield
"Usenet is a strange place" - dmr 29/7/1999
http://www.cpax.org.uk
email: rjh at the above domain, - www.
Richard Heathfield wrote:
> g said:
> > is there any library for C as Boost is for C++?
>
> There are lots of libraries available with C bindings.
True, but that doesn't answer the question....
tr1::shared_ptr and boost::shared_ptrWhat was the justification for the tr1 shared_ptr not to allow a custom
deleter like the boost::shared_ptr?
---
[ comp.std.c++ is moderated. To submit articles, try just posting with ]
[ your news-reader. If that fails, use mailto:std-c++@ncar.ucar.edu ]
[ --- Please see the FAQ before posting. --- ]
[ FAQ: http://www.comeaucomputing.com/csc/faq.html ]
Axter wrote:
> What was the justification for the tr1 shared_ptr not to allow a custom
> deleter like the boost::shared_ptr?
>
There is none. It's part of the T...
#include <boost/shared_ptr.hpp> or #include "boost/shared_ptr.hpp"?Is there a general rule/convention for when to use angle brackets and
when to use quotes in #include statements? Is the angle bracket reserved
for "system" header files (e.g. standard library headers), or is it for
general "stable" include files?
What about the grey areas in between these and actual application code,
e.g. headers for a library that is under my control but external to the
project being compiled?
I know both styles work, and in the case of the Boost headers I've seen
both of them used in example code, I'm just wondering if one is more
"c...
lack of implicit casting to T* and boost::shared_ptr::get()Does anyone know the reasons for the lack of an implicit casting
operator in any greater depth than:
A. Automatic conversion is believed to be too error prone.
(from the FAQ at the bottom of: http://www.boost.org/libs/smart_ptr/shared_ptr.htm)
Can anyone say specifically what about the implicit conversion would
be dangerous? I can think of a few things that would require care
about usage of smart pointers with implicit conversions, but nothing
that I would consider 'error-prone'.
In any language, there are implications and C++ certainly has its fair
share of other implicit behavio...
How to get BOOST working on XP and Visual C++ 2005My experiences with BOOST on Windows XP and Visual C++ 2005
I'm new to Python.
I built software in more than ten other computer languages. I'm not
sure if that is not a handicap, when reading documentation of a system
like BOOST.
However:
It took me more than four full working days to get a Python/C/C++
'hello world!' program to work. There is a lot of documentation, but
somehow it did not 'click' with my previous experience. I think the
doc was written by very, very capable C++ and Python programmers, who
forgot how the world was before they got involved with Python.
...
get the shape of a numpy ndarray in C++ code [boost.python][sorry is half a post appeared earlier. Bloody Google groups...]
Hello,
I'm trying to use a numpy array in C++ (win2000) using boost.python.
Test code:
void test( numeric::array& nsP)
{
object shape = nsP.getshape();
int rows = extract<int>(shape[0]);
int cols = extract<int>(shape[1]);
}
At first, running it in Python got me this message:
ArgumentError: Python argument types in
d3d.wr_conn(numpy.ndarray)
did not match C++ signature:
wr_conn(class boost::python::numeric::array {lvalue})
I fixed this using this line:
numeric::array::set_...
Better C/C++ Than C/C++?I am looking for a good systems programming language
that can be used instead of C/C++. My qualifications
for the language are:
* mature compiler(s) that produce native-code
binaries (for Windows)
* open source - preferable, but not 100% necessary
Thanks,
Kevin
"Kevin Albrecht" <kevin@albrecht.net> writes:
> I am looking for a good systems programming language
> that can be used instead of C/C++. My qualifications
> for the language are:
>
> * mature compiler(s) that produce native-code
> binaries (for Windows)
Ocaml, D, cyclone, Eiffel, Beta
>...
jython and C-c C-cHow do I get C-c C-c to work with jython? I have the jpython command set to
jython, and I can start the interpreter with C-C ! and then use C-c C-c, but
this is rather frustrating. If I try to use C-c C-c without first starting
the interpreter in another window I get
wrong type argument: sequencep, jpython
Thanks,
Dave Cook
...
Boost python : get the shape of a numpy ndarray in C++ code.Hi there.
I'm strugling here with some boost python code (damn I hate C++) :
All I want to do is to initialize the content of an array with a numpy
ndarray parameter. I have this, which actually works. But I want to
add some kind of data check such as :
* is array two dimensional ?
* are the dimensions corresponding to map's width / height ?
* is array field with floats or ints ?
void
Layer::set_potentials (numeric::array& array)
{
for (int h=0; h<map->height; h++){
for (int w=0; w<map->width; w++){
units[w+h*map->width]->potential =
extract<flo...
How do you get the username from the user_id (in c/c++)I am making a list of users and the amount of space they are using on a
device.
I traverse the file system and get a list of filenames.. I use these
filenames and
do an fstat on each... fstat (on my MAC OS X) machine returns a
structure that
contains the filesize and also the user_id. (This is a c program I'm
writing.)
My question is how do I convert the user_id into the users name?
(which should be a null terminated string.) What is the function call?
TIA.
B.
On Fri, 10 Dec 2004, JustSomeGuy wrote:
> My question is how do I convert the user_id into the users name?
> (which s...
What are the differences between std::shared_ptr and boost::shared_ptr?What are the differences between std::shared_ptr and boost::shared_ptr?
I just know they are, but don't know where.
Thanks.
* Kai Wen, on 14.09.2010 04:02:
> What are the differences between std::shared_ptr and boost::shared_ptr?
> I just know they are, but don't know where.
> Thanks.
Mostly none (except for the namespace), because std::shared_ptr was adopted from
boost::shared_ptr.
There may be a difference with respect to custom deleter replacement, and
perhaps with respect to conversions and perhaps also iostream operator<<
support, that is, that pe...
How to get signed zeros in C++/C?I don't find how to express signed zeros in C++/C. Does anybody know what is the proper way to do so? Are they just -0.0 and +0.0? How to distinguish signed zeros from true zeros.
http://en.wikipedia.org/wiki/Signed_zero
Regard,
Peng
Peng Yu <pengyu.ut@gmail.com> writes:
> I don't find how to express signed zeros in C++/C. Does anybody know
> what is the proper way to do so? Are they just -0.0 and +0.0? How to
> distinguish signed zeros from true zeros.
>
> http://en.wikipedia.org/wiki/Signed_zero
AFAIK there is no literal for those. You need to ...
Just getting started in C++, C+Thanks in advance to all of you,
Your recommendations:
What kind of instruction and software are needed to learn and do useful
programming using C+, C++ ?
I would like to access and use the windows graphics environment.
SRabin,
> What kind of instruction and software are needed to learn and do useful
> programming using C+, C++ ?
There is nothing like C+.
A good tutorial: http://www.cplusplus.com/doc/tutorial/
> I would like to access and use the windows graphics environment.
Free: DevC++ (core c++, that black command line window) + WxWidgets
(for graphical user interfaces)
C...