I am working on a specific application created in Java. The java level talks about the C ++ layer, which performs the logic of generating sql queries from the database and returns the result back to the Java level.
With a simpler example:
On the java side
nameField = new JTextField(20) //20 chars max length
name = t.getText() // name is sent to CPP layer
At the CPP level, the name from the java level is accepted and stored in the local variable cppName. I am confused by the declaration of variables used in the CPP layer. Most of them are declared as follows:
char cppName[20*4+1]
I want to know the value 20 * 4 + 1 here. The reason for declaring all the variables on the cpp side with a size like javaSize * 4 + 1.
source
share