Questions tagged [cross-language]

In programming, "cross-language" or "multi-language" refers to features that operate across multiple programming languages.

In programming, "cross-language" or "multi-language" refers to features that operate across multiple programming languages.

Cross-language features include type systems, data formats, storage layouts, etc. which are common across multiple languages. They help applications or services written in different languages to inter-operate and exchange information.

112 questions
5
votes
4 answers

How I can access my C++ function in my C code or vice versa?

I want to implement a project in C, but it is comfortable to code some part of project in C++ and then call them from main C code. Is it possible?! if yes, how I can do it?! thanks in advance :) P.S. I used some libraries in my C++ Code such as…
S0H31L
  • 359
  • 7
  • 20
5
votes
2 answers

Encrypt in PHP, Decrypt in Python

PHP code: $key = "12345678abcdefgh12345678abcdefgh"; $iv = "12345678abcdefgh"; $plaindata = "This is a test string."; $enc = base64_encode(mcrypt_encrypt(MCRYPT_RIJNDAEL_128, $key, $plaindata, MCRYPT_MODE_CBC,…
user812120
  • 545
  • 1
  • 8
  • 19
4
votes
1 answer

How to call a Java programme from .Net?

I have a little java programme, that responsible for sending message via mobile phone, and which is a native programme on the PC. But we won't convert it to .net, but it can be execute via dos cmd like: java jar my_send_message.jar -p 12345678 -m…
DNB5brims
  • 25,200
  • 45
  • 121
  • 180
4
votes
0 answers

Haskell executable linking with static library written in C++ got `undefined reference`

I've create a static library: // foo.h extern "C" { int foo (const char* arg0, int arg1); } // foo.cpp #include "foo.h" // implementation of foo This block of code was compiled to foo.o and packaged into libfoo.a which was installed to MinGW's lib…
claude
  • 227
  • 1
  • 8
4
votes
1 answer

Cannot use java value as parameter to java annotation on scala function

I have 3 java files: HW.java, myAnn.java, and Constants.java in package myApp. Constants.java: public final class Constants { public static final String WORLD ="World"; } myAnn.java: public @interface myAnn { java.lang.String name() default…
scalapeno
  • 812
  • 1
  • 6
  • 12
4
votes
3 answers

Why do dynamic arrays in C++ and Java have different initial capacities?

So I've been searching for how actually dynamic array works in general. what i found is two different concepts. In C++ In C++, dynamic array is generally implemented by vectors. Vectors set the capacity to 0, increases the count to insert new…
secretgenes
  • 1,151
  • 1
  • 17
  • 34
4
votes
1 answer

Integration of Java and Python 3.x Code in One Project

I am writing my project using python 3.x. I've come to a stage where I needed to write some code in Java.Is there anyway to integrate Python 3.x and Java? I am acknowledged about Jython.But it does not support Python 3.x as i know. Thanks in…
Mahir Mahbub
  • 94
  • 1
  • 10
4
votes
4 answers

Allowing a method to lock its parent Object in Java

Is there a way in Java to get a method to lock (mutex) the object which it is in? I know this sounds confusing but basically I wan't an equivelent to this snippet of C# but in Java. lock(this) { // Some code here... } I've been tasked with…
Omar Kooheji
  • 50,943
  • 65
  • 176
  • 234
4
votes
3 answers

Importing module from string in the Python C API

Importing Python modules from files is relatively easy with the Python C API with PyImport_Import() however I would need to use functions stored in strings. Is there a way to import python modules from strings (to clarify: there is no file; the code…
Hullu2000
  • 251
  • 2
  • 18
4
votes
1 answer

How to build a C dependency of go project in a subdirectory

I am writing a Go wrapper for a C library in Go. The problem is, that the C library is not available on many Linux distributions, so I want a solution where i "go get github.com/me/mylibrary" does not require anybody to have the library…
Arne
  • 7,206
  • 4
  • 41
  • 60
4
votes
1 answer

is there a generic query language for arbitrary sets independent from a programming language?

I'm looking for a way to define queries on sets independently from a programming language or the kind of sets. In detail this would be a language definition and implementations for common languages like Java, C++, Python etc. As commented I'm not…
frans
  • 6,905
  • 8
  • 40
  • 95
4
votes
4 answers

What is a Cobol 88-type equivalent in another languages?

I'm learning COBOL now and really liking the 88-type of variables, and I want to know if there are anything like them in another languages (most known languages also, such as C, Objective-C), even using a library. The only thing I can think being…
GBF_Gabriel
  • 2,462
  • 2
  • 14
  • 14
4
votes
3 answers

Keeping the same logic implemented in C# and JS in sync

There is a need to have a calculator for our invoices which will be used both in the web UI and in the back-end. This requires two implementations of the same logic in Javascript and C# and the real problem is to keep these two logics in sync when…
Mehrad Sadegh
  • 1,006
  • 10
  • 22
3
votes
1 answer

Strategies for sharing common business logic across different programming languages

Having a monolithic business application with complex business logic implemented in Visual Dataflex, we are facing the challenge of maintaining our business logic across programming languages as certain features are written in other programming…
Ola Eldøy
  • 5,291
  • 6
  • 43
  • 72
3
votes
2 answers

How to use internal c++ class types from C?

I have a C++ class MyClass that declare a public enum type MyEnum, and I want to use that enum in a C file. How can I do that ? I tried to declare my functions in a C++ file and then put everything as extern "C", but sadly I am using some functions…
4nti7rust
  • 96
  • 9