I have a code that writes data into shared memory. I want to read this data and store it into cassandra database. The code that writes into shared memory is in C and cassandra has a C++ API. Can I now use this C++ API which is used by c code that reads the data from shared memory and calls these library functions to store it and read from casssandra?
Asked
Active
Viewed 210 times
0
-
5So you are asking if C++ can read from shared memory? – Jon Sep 19 '13 at 13:49
-
I think he's asking whether his C code can call the Cassandra C++ functions. – Kristopher Johnson Sep 19 '13 at 13:52
-
1Take a look around. :) http://stackoverflow.com/questions/2744181/how-to-call-c-function-from-c http://stackoverflow.com/questions/2399344/calling-c-code-from-c http://stackoverflow.com/questions/12615683/calling-c-functions-from-c-file – NotAgain Sep 19 '13 at 13:52
-
I don't quite understand your question. By "Can I now use this C++ API which is used by c code that... and calls ..." Do you mean "Can I now use this C++ API *from my* c code that... *in order to* ..."? – TooTone Sep 19 '13 at 13:54
-
1@Kristopher, I agree with Jon: seems the OP is having the XY problem :P – SingerOfTheFall Sep 19 '13 at 13:55
-
I guess he is asking about the point of the standards. As there are many points where c and c++ rules are corresponding. Same I asked my self some days ago, can i call a C++ functiosn from a API in c which are ok for c++ but are invalid from c standard's view. – dhein Sep 19 '13 at 14:00
-
Question should indicate platform and compiler vendor(s), as those things may may determine the answer. – Kristopher Johnson Sep 19 '13 at 14:03
-
1http://www.cs.uregina.ca/Links/class-info/210/C++FAQ/mixing-c-and-cpp.html – Sep 19 '13 at 14:03
-
@Jon my question was if I could write a c code that reads from the shared memory and that can call the c++ functions in the API to store into cassandra.. – bnsk Sep 19 '13 at 15:30
-
@Johnson I am currently using Ubuntu 12.04 with GNU c and C++ compilers... – bnsk Sep 19 '13 at 15:31