Using JNI to pass an array of Strings to C and back from C

I have some C code that I want to integrate with a new Java application and I need to be able to pass an array of strings to the C program and then the C program needs to be able to build an array of strings that is passed back to the Java program. I've got the first part working so that I can pass an array of strings to the C program and display them, but I can't figure out how to build the strings in C so that that when Java gets back control, it can display the strings tha were built in the C program.
Has anyone done this? Do you have some sample code?

I have a program which is written in C. I can give you the whole project as it is in a zip file. You'll need VC to work with it. By the way, I am using Windows for development. Should you need it, I'll mail you the same. Give me your mail address.

Similar Messages

  • Is there a way to type cast an array of strings to numbers and back again?

    I'm working on an application where I want to type cast a string like "power supply" into an array of existing numbers. Then sort the existing numbers, and finally convert the casted numbers back into a string so it can be read by the user. In the attachment, you can see my latest attempt with flatten/unflatten data and the 'convert string to byte array'. I can't seem to make this work. Any ideas?
    Thanks - Paul
    Attachments:
    Paul's Temp scan for components.vi ‏56 KB

    OK, here's a quickie (LabVIEW 7.0).
    Simply get the sort key from the 1D array, then build the table.
    Message Edited by altenbach on 10-27-2006 01:34 PM
    LabVIEW Champion . Do more with less code and in less time .
    Attachments:
    SortedTable.png ‏4 KB
    SortedTable.vi ‏37 KB

  • How do I pass an array of strings? (Help Me... Please!!! .Read Me....)

    Dear All.
    Help Me...
    English is not very good. Google translator is used.
     How do I pass an array of strings?
    Please refer to the VB program
     ===========================================
    Private Sub m_btn_Click()
        Dim nReturn As Long
        Dim sPpid As String
        Dim sMdln As String
        Dim sSoftRev As String
        Dim nCount As Long
        Dim saCCodes(2) As String
        Dim naPCount(2) As Long
        Dim saPNames(10) As String
        sPpid = "PPID001"
        sMdln = "Mdln"
        sSoftRev = "Rev001"
        nCount = 2
        saCCodes(0) = "1"
        naPCount(0) = 5
        saPNames(0) = "Param001"
        saPNames(1) = "Param002"
        saPNames(2) = "Param003"
        saPNames(3) = "Param004"
        saPNames(4) = "Param005"
        saCCodes(1) = "2"
        naPCount(1) = 5
        saPNames(5) = "Param006"
        saPNames(6) = "Param007"
        saPNames(7) = "Param008"
        saPNames(8) = "Param009"
        saPNames(9) = "Param010"
        nReturn = m_XGem.GEMReqSend(sPpid, sMdln, sSoftRev, nCount, saCCodes(0), naPCount(0), saPNames(0))
        If (nReturn = 0) Then
            Call Me.AddMessage("[EQ ==> XGEM] GEMReqSend successfully")
        Else
            Call Me.AddMessage("[EQ ==> XGEM] Fail to GEMReqSend (" & nReturn & ")")
        End If
    End Sub
    =================================================
    nCount, naPCount enough saCCodes, saPNames value must be sent.
    How to handle an array of strings in LabView is impatient.
    I want to VB program implemented in LabView.

    Have you actually tried to right click on the according node parameter and select Create->Constant or Create-Control??
    And I don't see any string array in the parameter list. That are all simple strings and the VB code in your first post clearly shows that the call to the function only indexes the first element of those arrays to be passed to the function, not the entire array.
    If the function really reads arrays despite being declared as only taking strings then it is using some weirdo VB trickery and there will be no way to replicate that in LabVIEW.
    Rolf Kalbermatter
    CIT Engineering Netherlands
    a division of Test & Measurement Solutions

  • JSP Tag- Passing an array of string as an Attribute

    Can I pass an array of String as an attribute to a JSP Tag? I read the specification but It does not say any thing about this.
    Thanks in Advance.

    I thought JSP tags had to deal strictly with string values?

  • How do I use Garage Band to practice my guitar against lesson CDs and backing track CDs

    How do I use Garage Band to practice my guitar against lesson CDs and backing track CDs

    GarageBand on your Mac or on an iPad?
    If you are asking abot GB on a Mac you do the following:
    Create a new GarageBand project with a Guitar track
    Insert the CD and drag the audio file of the Lesson track or backing track to an empty region below the tracks in the timeline of the GarageBand window.
    Plug in a set of head phones and put them on to listen to your backing track.
    Plug in your guitar and select the guitar track.
    Click on the measure where you want to start your recording and select the guitar track.
    Press "record" and start to play.
    Regards
    Léonie

  • Array of strings in container won't pass to array of strings in LabVIEW cluster

    I'm new to TestStand but am a CLD.  I've taken a 3-day custom course that covered most of TestStand Core 1 and some of Core 2.  I'm using TestStand 2013 and LabVIEW 2013.
    I have a VI that needs an input of a cluster containing, in this order:
    1D array of strings named Column_Labels
    2D array of doubles named Results_Data
    1D array of paths named Graphics_File_Paths
    1D array of booleans named Pass_Fail
    In TestStand I created a custom data type called Maxim_Results from the VI module tab in the sequence.  When I reference a local (MINSYS_Reuslts) that is made from this Type I get the following error:
    No corresponding subproperty in argument 'Locals.MINSYS_Results' of type 'Maxim_Results' for cluster element 'Maxim_Results.Column_Labels'
    If, however, I reference each container element to each cluster element separatley there is no error:
    Can anyone help me understand why this is happening?
    Kelly Bersch
    Certified LabVIEW Developer
    Kudos are always welcome
    Solved!
    Go to Solution.

    Hey Kelly,
    I just set up the situation you described, and it worked properly for me. However, I did notice that in your example where you referenced each element individually, your Column_Labels element is actually called "Column_Lables". If this was also misspelled in the LabVIEW Cluster Passing setting for the custom type, it would cause the behavior you're seeing. Could this possibly be the case?
    Daniel E.
    TestStand Product Support Engineer
    National Instruments

  • Using BC4J to pass an array to a stored function

    I have successfully implemented the use of BC4J view objects to pass and retrive values from a stored database procedure/function as per Steve Muench's paper.
    What I am having difficulty achieving is passing through an array to a stored function. I have a multiple selection table where on submit, I retrieve the selected values and want to be able to put them in a array and pass them to a stored function.
    At the database level, I have created a nested table with one of the columns being a table of numbers. A wrapper function is called with the array type being one of the in parameters and the database updated.
    I am however having no luck building the array in my Java code and passing it to the database through an expert-only view object.
    I have :
    1. Database wrapper function has an extra parameter for the table of numbers (number(10))
    2. Changed the view object query to include the extra parameter (of type Number[])
    3. Changed the relevant view object and transaction Impl classes to pass through an array of oracle.jbo.domain.Number
    4. Update my test module class to
    -- Test module class
    String _am = "transaction2.transaction2module", _cf = "Transaction2ModuleLocal";
        String str1 = "String1";
        String str2 = "String2";
        String str3 = "String3";
        Number[] num4 = {new Number(1001),new Number(1002),new Number(1003),new Number(1004)};
        Transaction2Module testModule = (Transaction2Module)Configuration.createRootApplicationModule(_am,_cf);
        TxnResultType txnResult = testModule.getTxnResult(str1,str2,str3,num4);
    -- Transaction2ModuleImpl.java
    public ProcessTransactionImpl getProcessTxn()
        return (ProcessTransactionImpl)findViewObject("ProcessTxn");
      public TxnResultType getTxnResult(String p1, String p2, String p3, Number[] p4)
        return getProcessTxn().getTxnResult(p1, p2, p3, p4);
    -- ProcessTxnImpl.java
    public TxnResultType getTxnResult(String p1, String p2, String p3, Number[] p4)
        setWhereClauseParam(0,p1);
        setWhereClauseParam(1,p2);
        setWhereClauseParam(2,p3);
        setWhereClauseParam(3,p4);
        executeQuery();
        return ((ProcessTransactionRowImpl)first()).getTxnResult();
      }but the error message given is :
    oracle.jbo.SQLStmtException: JBO-27122: SQL error during statement preparation. Statement: select transaction_wrapper(:0, :1, :2, :3) as txn_result from dual
    java.sql.SQLException: Invalid column type
         void oracle.jdbc.dbaccess.DBError.throwSqlException(java.lang.String, java.lang.String, int)
    Can anyone offer some suggestions ?
    Thanks,
    Brent

    Thanks for the reply - I had nearly given up on this ! I did add the setWhereClause statement as you suggested
    setWhereClause("p1=:0 and p2=:1 and p3=:2 and p4=:3");but still got the same error. I have posted the entire output which may help you see what's still going wrong (hopefully!)
    oracle.jbo.SQLStmtException: JBO-27122: SQL error during statement preparation. 
    Statement: SELECT * FROM (select test_array(:0,:1,:2,:3) as result from dual) QRSLT  WHERE (p1=:0 and p2=:1 and p3=:2 and p4=:3)
         void oracle.jbo.server.QueryCollection.executeQuery(java.lang.Object[], int)
              QueryCollection.java:541
         void oracle.jbo.server.ViewObjectImpl.executeQueryForCollection(java.lang.Object, java.lang.Object[], int)
              ViewObjectImpl.java:2650
         void oracle.jbo.server.ViewRowSetImpl.execute(boolean, boolean)
              ViewRowSetImpl.java:523
         void oracle.jbo.server.ViewRowSetImpl.executeQuery()
              ViewRowSetImpl.java:564
         void oracle.jbo.server.ViewObjectImpl.executeQuery()
              ViewObjectImpl.java:2614
         java.lang.String mypackage5.TxnViewImpl.getResult(java.lang.String, java.lang.String, java.lang.String, oracle.jbo.domain.Number[])
              TxnViewImpl.java:25
         java.lang.String mypackage5.TransModuleImpl.getResult(java.lang.String, java.lang.String, java.lang.String, oracle.jbo.domain.Number[])
              TransModuleImpl.java:29
         void mypackage5.TestArray.main(java.lang.String[])
              TestArray.java:17
    ## Detail 0 ##
    java.sql.SQLException: Invalid column type
         void oracle.jdbc.dbaccess.DBError.throwSqlException(java.lang.String, java.lang.String, int)
              DBError.java:187
         void oracle.jdbc.dbaccess.DBError.throwSqlException(int, java.lang.Object)
              DBError.java:229
         void oracle.jdbc.dbaccess.DBError.throwSqlException(int)
              DBError.java:292
         void oracle.jdbc.driver.OraclePreparedStatement.setObject(int, java.lang.Object, int, int)
              OraclePreparedStatement.java:2782
         void oracle.jdbc.driver.OraclePreparedStatement.setObject(int, java.lang.Object)
              OraclePreparedStatement.java:2905
         boolean oracle.jbo.server.ViewRowSetImpl.bindParameters(java.lang.Object[], java.sql.PreparedStatement)
              ViewRowSetImpl.java:1313
         void oracle.jbo.server.QueryCollection.executeQuery(java.lang.Object[], int)
              QueryCollection.java:511
         void oracle.jbo.server.ViewObjectImpl.executeQueryForCollection(java.lang.Object, java.lang.Object[], int)
              ViewObjectImpl.java:2650
         void oracle.jbo.server.ViewRowSetImpl.execute(boolean, boolean)
              ViewRowSetImpl.java:523
         void oracle.jbo.server.ViewRowSetImpl.executeQuery()
              ViewRowSetImpl.java:564
         void oracle.jbo.server.ViewObjectImpl.executeQuery()
              ViewObjectImpl.java:2614
         java.lang.String mypackage5.TxnViewImpl.getResult(java.lang.String, java.lang.String, java.lang.String, oracle.jbo.domain.Number[])
              TxnViewImpl.java:25
         java.lang.String mypackage5.TransModuleImpl.getResult(java.lang.String, java.lang.String, java.lang.String, oracle.jbo.domain.Number[])
              TransModuleImpl.java:29
         void mypackage5.TestArray.main(java.lang.String[])
              TestArray.java:17
    Exception in thread main
    Process exited with exit code 1.I had to do a new example as I could not find the code I was using earlier. This is my java class
    import oracle.jbo.client.Configuration;
    import oracle.jbo.domain.Number;
    import mypackage5.common.TransModule;
    public class TestArray
      public static void main(String[] args)
        String _am = "mypackage5.TransModule", _cf = "TransModuleLocal";
        String str1 = "String1";
        String str2 = "String2";
        String str3 = "String3";
        Number[] num4 = {new Number(1001),new Number(1002),new Number(1003),new Number(1004)};
        TransModule testModule = (TransModule)Configuration.createRootApplicationModule(_am,_cf);
        String txnResult = testModule.getResult(str1,str2,str3,num4);
        System.out.println("Result = " + txnResult);

  • Passing int arrays to strings

    I'm having trouble passing an array of integers to a string and vice versa i.e. the array has
    element[0] =1
    element[1] =0
    element[2] =0 but it can hold up to 16 elements
    what I want is for this array which holds a binary number represented by ints to be represented as the string "001". Im passing the method an array then I want it to loop the length of the array and store each element as a part of the string. I then want to add the number to another number put it back in an array and return it. If anyone has any help I would appreciate it.
    Thanks.

    public class YourClass {
         public static String arrayToString(int[] theArray) {
              int lim = theArray.length;
              StringBuffer sb = new StringBuffer();
              for (int i = 0; i < lim; i++) {
                   sb.append(String.valueOf(theArray));
              return sb.toString();
         public static int[] stringToArray(String theString) {
              int lim = theString.length();
              int[] theArray = new int[lim];
              for (int i = 0; i < lim; i++) {
                   theArray[i] = Integer.parseInt(theString.substring(i, i+1));
              return theArray;
         public static void main(String[] args) {
              int[] theArray = {1,0,0,1,1};
              String theString = arrayToString(theArray);
              System.out.println(theString);
              int[] theArray2 = stringToArray(theString);
              System.out.println(arrayToString(theArray2));

  • Passing a large 3D-array to a sub vi and back causes huge loss of performance

    I am passing a large 3D-Array of type I16 to a sub-vi node of same type, and back to the main VI. For test purposes I have removed all processing in between. Still, the sub-vi call requires many ms to s, depending on array size. I was under the impression that variables are passed to sub-VIs by reference. Is this incorrect? can it be fixed?
    Johannes

    Hi Johannes,
    (There may be exceptions but) No, variables are not passed and returned by reference.
    "A fix" may be possible by restructuring your app such that the large 3d array never gets moved around. This can be done by using what I call an action engine. It uses a variation of the LV2 global to store the large array ONE TIME in a shift register. After that, all other operations are performed "in-place".
    This technique has allowed me to process very large data sets "on-the-fly".
    Ben
    Ben Rayner
    I am currently active on.. MainStream Preppers
    Rayner's Ridge is under construction

  • My BT keyboard delete button now forward deletes rather than backspacing like it used to do. This happened after I got my iMac back from the hard drive replacement program. Any ideas how to return the keyboard to the default backspace?

    The good news after my hard drive was replaced during Apple's Seagate replacement program -- all my data and settings reinstalled seamlessly through Time Machine and my external hard drive. Bad news? My BT keyboard will now only forward delete when I hit the delete key rather than backward delete. I find this so ironic since I hated this feature when I switched from PC to Mac, but now I'm totally used to it. I tried resetting the default under system preferences, but it didn't help. Otherwise, keyboard works perfectly. This is so strange. Anyone have any suggestions? Oh -- and now I see my arrows don't work either.
    Message was edited by: juliefrommiami

    The good news after my hard drive was replaced during Apple's Seagate replacement program -- all my data and settings reinstalled seamlessly through Time Machine and my external hard drive. Bad news? My BT keyboard will now only forward delete when I hit the delete key rather than backward delete. I find this so ironic since I hated this feature when I switched from PC to Mac, but now I'm totally used to it. I tried resetting the default under system preferences, but it didn't help. Otherwise, keyboard works perfectly. This is so strange. Anyone have any suggestions? Oh -- and now I see my arrows don't work either.
    Message was edited by: juliefrommiami

  • I am unable to use Iboost app, when i try to use it, I get an error "iBoost App is damaged" and reinstall from app store. I get the same error even after installing a fresh copy. Need help to resovle this issue.

    “iBoostUp.app” is damaged and can’t be opened. Delete “iBoostUp.app” and download it again from the App Store.
    Because of the above error, i am not able to use iboostup application. I have even tried to reinstall from app store, but the issue still continues.
    Need help.

    Perhaps the damaged file is an auxiliary file outside the app bundle and stored elsewhere on your Mac. Try deleting the app and all it files with an app for that purpose. Afree one is AppCleaner;
    http://www.freemacsoft.net/appcleaner/

  • How can I resize an array of strings?

    I'm having a problem of not being able to use the CIN functions and therefore can't use the convenient resizing methods. I have tried to use NumericArrayResize to resize an array of strings, but it's not working correctly. Here's what I've tried most recently. I have tried many variations, so if you want to modify what I have posted, or just provide new code, please feel free.
    typedef struct {
    int32 dimSize;
    LStrHandle elt[1];
    } LStrHandleArray;
    typedef LStrHandleArray **LStrHandleArrayHandle;
    void someMethod(LStrHandleArrayHandle arrayOut) {
    // attempting to write the string "asdf" in the first element in the array. (1D array)
    int newSize = 1;
    MgErr e = NumericArrayResize(uL, 1L, (UHandle*)&arr
    ayOut, newSize);
    (*arrayOut)->dimSize = newSize;
    LStrHandle hdl = *(*arrayOut)->elt;
    long str_size = strlen("asdf");
    MgErr err = NumericArrayResize(uB, 1L,(UHandle *)&hdl, str_size);
    LStrLen(*hdl) = str_size;
    MoveBlock("asdf", LStrBuf(*hdl), str_size);
    The code above doesn't result in crashing labview at any time. The string "asdf" is not copied though. And, after being able to copy one string I would like to extend this to many elements in a 1D array of strings.
    Thanks!
    Naveen

    LabVIEW stores string arrays as an array of handles to those strings. To resize an array of strings you need to declare a new string in LabVIEW's data space, resize the handle array, and add a handle to your new string. Here is an example program which does this.
    -Aaron Marks
    National Instruments
    Attachments:
    resize.zip ‏252 KB

  • We are using jni.h but its getting errors, please check it this

    We are using jni.h but its getting errors, please check it this
    Calling from a .dll using Java and JNI - by Borland Developer Support Staff
    Abstract:Basic JNI example: making a Win32 API call
    Making Native Windows API calls from within a Java Application
    One of the main points of Java is to be completely platform independent. However, sometimes it will occur that the developer of an
    application will know that his or her application is only going to be run on a specific platform, for example, Win32.
    NOTE: This example assumes that you are using JDK 1.2 or later.
    Below are the steps for writing a Java application that makes a Win32 API call. The application generates a Swing Jframe and makes it
    system modal, or gives it the �Always On Top� functionality, similar to that of the Windows NT Task Manager.
    Steps to follow:
    1. Write the Java code for the application
    2. Run javah.exe on your .class file to generate a C header file
    3. write the implementation of your native methods
    4. create the shared library
    5. run the application
    1. Write the Java code for the application
    import java.awt.*;
    import sun.awt.*;
    import sun.awt.windows.*;
    import javax.swing.*;
    import java.awt.event.*;
    public class Frame1 extends JFrame {
    int windowHWND = 0;
    JButton jButton1 = new JButton();
    public Frame1() {
    //windowHWND = this.getHwnd();
    try {
    jbInit();
    catch(Exception e) {
    e.printStackTrace();
    public int getHwnd() {
    DrawingSurfaceInfo w = (DrawingSurfaceInfo) ((DrawingSurface) getPeer()).getDrawingSurfaceInfo();
    w.lock();
    WDrawingSurfaceInfo win32 = (WDrawingSurfaceInfo) w;
    int hwnd = win32.getHWnd();
    w.unlock();
    return hwnd;
    static {
    System.loadLibrary("windowOnTop");
    public static native void WindowAlwaysOnTop(int hwnd, boolean flag);
    public static void main(String[] args) {
    Frame1 frame11 = new Frame1();
    frame11.setSize(400,400);
    frame11.setVisible(true);
    private void jbInit() throws Exception {
    jButton1.setText("jButton1");
    this.addWindowListener(new java.awt.event.WindowAdapter() {
    public void windowOpened(WindowEvent e) {
    this_windowOpened(e);
    public void windowClosing(WindowEvent e) {
    this_windowClosing(e);
    this.getContentPane().add(jButton1, BorderLayout.NORTH);
    void this_windowOpened(WindowEvent e) {
    windowHWND = this.getHwnd();
    System.out.println("the value is: " + this.getHwnd());
    this.WindowAlwaysOnTop(windowHWND, true);
    void this_windowClosing(WindowEvent e) {
    System.exit(0);
    Once the code is written, compile it with Jbuilder or the command line javac.exe tool which will result in a generated .class file. You will use
    this .class file in the next step.
    2. Run javah.exe on your .class file to generate a C header file
    The following line represents the basic syntax for running javah.exe:
    javah Frame1
    where Frame1 is the name of the argument class.
    When you run javah.exe, it will generate a header file by the same name as your implementation but with a .h file extension. For this
    example the .h file that was generated from the above Java code will be emitted being that it is quite large.
    NOTE: Make sure that when you run javah.exe, it is the javah.exe that came with the same JDK that you will be compiling with as there may
    be some issues with using a version of javah.exe that is different from that of the JDK you are using to compile.
    3. write the implementation of your native methods
    Now that you have your Java source and your C header file, it is time to write the implementation of your native methods.
    Following is the C code that corresponds to the native methods declared in the Java code listed in step 1:
    #include "jni.h"
    #include "Frame1.h"
    #include <stdio.h>
    #include<windows.h>
    JNIEXPORT void JNICALL Java_Frame1_WindowAlwaysOnTop(JNIEnv *env, jclass obj, jint hwnd, jboolean flag)
    if (flag)
    SetWindowPos((HWND) hwnd,HWND_TOPMOST,0,0,0,0,SWP_NOMOVE|SWP_NOSIZE);
    else
    SetWindowPos((HWND) hwnd,HWND_NOTOPMOST,0,0,0,0,SWP_NOMOVE|SWP_NOSIZE);
    return;
    You will notice several things: one is that the function signature has �Java_Frame1_� preceeding the name of the function. If there was a
    package statement in the Java source, it would appear after ��Frame1_� in the function signature.
    Second, you will notice the #include �jni.h�. Normally this would be #include<jni.h>, depending on how you have your libraries set up within
    your C compiler.
    4. create the shared library
    Now you are ready to create the shared library. Using your C compiler, create a .dll file with the code from the C implementation file. Refer
    to the doccumentation of the C compiler for details on creating a .dll file.
    For those interested in using Borland C++ Builder:
    If you have got it installed, you could use Borland C++ Builder 3 or C++ Builder 4 to create your DLL file. If this is the case, you would use
    File | New... | DLL C++ Builder will then generate some code for you, and you will just need to add your implementation code to the code
    which was generated.
    Remember in the Java code in step one there is a line:
    static {
    System.loadLibrary("windowOnTop");
    �windowOnTop� is the name of the .dll file. You can name it whatever you want, just make sure that you specify the appropriate name when
    loading the library.
    5. run the application
    Finally you are ready to run the application. From the command line use java.exe and as the argument specify the name of the class that
    you compiled in step one. Once the system loads your DLL, the window that the VM creates should mimic the �Always On Top�
    functionality.
    We are getting errors like this
    �Compiling JNI.H:
    Error JNI_MD.H 23: , expected
    Error JNI.H 115: Declaration missing
    Error JNI.H 200: ) expected
    Error JNI.H 202: ) expected

    #include "jni.h"
    #include "Frame1.h"
    #include <stdio.h>
    #include<windows.h>
    JNIEXPORT void JNICALL Java_Frame1_WindowAlwaysOnTop(JNIEnv *env, jclass obj, jint hwnd, jboolean flag)
    if (flag)
    SetWindowPos((HWND) hwnd,HWND_TOPMOST,0,0,0,0,SWP_NOMOVE|SWP_NOSIZE);
    else
    SetWindowPos((HWND) hwnd,HWND_NOTOPMOST,0,0,0,0,SWP_NOMOVE|SWP_NOSIZE);
    return;
    We are getting errors like this
    �Compiling JNI.H:
    Error JNI_MD.H 23: , expected
    Error JNI.H 115: Declaration missing
    Error JNI.H 200: ) expected
    Error JNI.H 202: ) expected

  • Replacing words in an array of strings

    hi
    im trying to create a method that takes three arrays of strings as parameters and replaces some words in one of them
    heres my code
    class A0
    public static void main (String[] args)
    int index;
    String[] in = {"life","is","a","bowl","of","pits"};
    String[] what={"pits", "bowl"};
    String[] with={"chocolates", "box"};
    String[] result=new String [in.length];
    result=findAndReplace(in, what, with);
    for (index=0;index<in.length;index++)
    System.out.print(result[index]+" ");
    static String[] findAndReplace (String[] in, String[] what, String[] with)
    int index1;
    int index2;
    String[] newString= new String [in.length];
    for (index1=0;index1<in.length;index1++)
    for (index2=0;index2<what.length;index2++)
    if (in[index1]==what[index2])
    newString[index1]=with[index2];
    else
    newString[index1]=in[index1];
    return newString;
    ok so it's supposed to print life is a box of chocolates, only it prints life is a box of pits???pls help

    i figured it out

  • Management of large projects using JNI

    I've got some code written in C and I want to interact with these code using JNI. But these code comprehends lots of c and h files, spreaded in lots of directories. To compile all of these, I have some makefiles. My question is: how can I start managing all of these code using JNI, I mean, what could it be my start point? Should I try to change the c code that calls everything?
    Where can I put my new generated java, c and h files, in order not to generate a great mess?
    Thanks!
    Gilmar

    Where can I put my new generated java, c and h files,
    in order not to generate a great mess?In a directory besides the one that contains all of your other C/H code.

Maybe you are looking for

  • Apache Server Sizing and Web Dispatcher filtering

    Hi, We are planning to expose our intranet portal for internet user. An internet user would access it via browser (https) -> Apache - reverse proxy (outer DMZ) -> Web Dispatcher - Load Balancing (Inner DMZ) -> Portal. We are looking for end-to-end SS

  • Tool bar is disappearing

    Why is my tool bar in Internet Explorer disappearing all the time?  It's very annoying and I have to hover over the bar to close out my windows.  Please help!!

  • WIP: Creating packages for other distributions

    Hi, I didn't find any related articles, so I've decided to start work on one: https://wiki.archlinux.org/index.php/Us - tributions Looking for any input (especially about Fedora/RPM). Even telling me such an article would be useless. Cheers, Alad Las

  • I would like to be a drop-down

    I would like to be a drop-down menu that once you have select an item, would open another drop down with sub-items of the inherent checked early

  • Nokia 2720 calendar does not alert when it should

    Does anyone know what to do when Nokia 2720's calendar does not alert when it should? E.g. when I have set a reminder for Tuesday at 19.00 the phone starts to alert on Wednesday at 00.01. All day and time zone settings are correct. Calendard alerts h