0

I have a project wherein i need to write an application for an USRP device. But the gnuradio software which i use to interact with the device driver and ultimately the hardware provides apis in c++ and python. I am comfortable programming in c and thus would like a way which would let me to call the apis from my c program.Is there a way in which i could do so? It would be a lifesaver.

Wooble
  • 87,717
  • 12
  • 108
  • 131
phoenix
  • 549
  • 1
  • 7
  • 21
  • 1
    There's really no reason for you to use C for this. – TJD Sep 18 '12 at 17:49
  • @TJD...it is because i would have to learn c++ or python all over which stands against the fact that i am comfortable with c. – phoenix Sep 18 '12 at 19:30
  • 5
    If you can program C, then you can look at the GNU Radio examples and learn enough python to get by within a day. You gotta learn the right tools for the right jobs. C is the right tool in only a small set of applications. It's like you're comfortable rubbing sticks together to build a cook fire, but maybe you should spend a minute learning how to use a microwave. – TJD Sep 18 '12 at 19:55

1 Answers1

5

C++ adds a lot to C, but doesn't take much away. Except for a few corner cases (which can be worked around) most valid C code is also valid C++ code, so you won't encounter many problems when you compile it as C++. Just write your whole project in a C style and only use C++ features where they are necessary to interface with the C++ API of gnuradio.

Philipp
  • 67,764
  • 9
  • 118
  • 153