Deprecated conversion from string constant to 'char*'

Hi all
I am working with strings and i cant figure out why the following
warning appears at time of build.
warning: deprecated conversion from string constant to 'char*'
It appears for the line
char *myName = "Apple.txt";
Is there anyone who can help me?
Help is welcome.
Thanks in advance.

Any reason why you aren't using NSString in place of char?
char *myName = "Apple.txt";
NSString *myName = @"Apple.txt";

Similar Messages

  • Conversion from string "20041023 " to type 'Date' is not valid.

    Hi ,
       I have a table with one of the column(EmpHiredate) datatype is char(10). It has value like "20141023". I need to display this value as date format(dd/mm/yyyy) in report. 
    Following methods i tried in textbox expression but no luck.
    =Format(Fields!EmpHireDate.Value,"dd/MM/yyyy")
    =Cdate(Fields!EmpHireDate.Value)
    Error:
    [rsRuntimeErrorInExpression] The Value expression for the textrun ‘EmpHireDate.Paragraphs[0].TextRuns[0]’ contains an error: Conversion from string "20041023  " to type 'Date' is not valid.
    Is it possible to convert string to date using SSRS textbox expression ? Can anyone help me with the solution.
    Thanks,
    Kittu

    Hi Jmcmullen,
         Found one more issue on the same. I have one value like "00000000" for the column(EmpHiredate)
    , when i use above expression values(ex:"20141023")
    are displaying in dd/MM/yyyy format in report except value like "00000000" and giving following error:
    [rsRuntimeErrorInExpression] The Value expression for the textrun ‘EmpHireDate.Paragraphs[0].TextRuns[0]’ contains an error: Conversion from string "0000/00/00" to type 'Date' is not valid.
    Even i tried to pass its original value("00000000") as below but no luck.
    =IIF(Fields!EmpHireDate.Value = "00000000","00000000",Format(CDATE(MID(Fields!EmpHireDate.Value,1,4) + "/" + MID(Fields!EmpHireDate.Value,5,2) + "/" + MID(Fields!EmpHireDate.Value,7,2)),"dd/MM/yyyy"))
    Also tried this:
    =IIF(Fields!EmpHireDate.Value = "00000000","2000/10/21",Format(CDATE(MID(Fields!EmpHireDate.Value,1,4) + "/" + MID(Fields!EmpHireDate.Value,5,2) + "/" + MID(Fields!EmpHireDate.Value,7,2)),"dd/MM/yyyy"))
    Please Suggest. 
    Thanks ,
    Kittu

  • Conversion from string "" to type 'Double' is not valid

    We're using BPC 7.5 MS and on patch level 111.02
    There's two front-end servers and one back-end.  we have about 100 users but concurrency is likely in the 50 range.
    We've been running extremely well for about 4 years but are now starting to run into problems.
    There are about 5-6 applications but none greater than 10 million records.  We optimize regularly.
    However over the past two months admin processes seem to take a lot longer.  Optimization now times out after about 1.25 hours and none used to take greater than 15 minutes.
    Today after processing dimensions we checked the application status and we were not able to check if it was available or not.  We got a pop up box saying
    conversion from string "" to type 'Double' is not valid
    I've processed dimensions and applications since and still this error persists.
    We're attempting a reboot to see if that helps but I've never seen this before and in combination with the slower admin processing I'm wondering if there's something drastic going to happen.
    Michael

    Hi Michael,
    for the poor performances you have to check the guides about performance on bpc if you have scheduled regurarly optimize during day and night (just verify that never factwb reach 50.000 and fac2 500.000 records) maybe you need to change some parameter on the server as MaxThreads.
    For the conversion string error on admin console see please this note 1803092 - Set application set status error
    Regards
         Roberto

  • Char array conversion from String: toCharArray()

    Greetings,
    Can anyone tell me why this code:
    import com.wuw.debug.Trace;
    public
    class charTest
       public static void
       main( String[] args )
           String strIn = new String( "strIn" );
           Trace.DTRACE( "strIn: "+strIn );
           Trace.DTRACE( "strOut: "+strIn.toCharArray() );
    }produces this output:
    [DTRACE]: strIn: strIn
    [DTRACE]: strOut: [C@1fef6f
    and not:
    [DTRACE]: strIn: strIn
    [DTRACE]: strOut: strIn

    Because:
    String.toCharArray returns an array of chars.
    An array is basically an object in java.
    Objects are converted to strings with the method toString - if it's not implemented in your class the string that method returns will be of the form classname@hashcode.
    In the case of a char array, the name of the class is "[C". The hashcode of you object seems to be "1fef6f" (in hex).
    You'll just have to remember that an array of chars is [i]not a string in java.

  • Why is conversion from array/vector of chars to jcharArray not working?

    This really is an array/vector of chars, not a string (i.e. not a char* string).
    jcharArray convert(JNIEnv* env, const std:vector<char> vect)
         int size = vect.size();
         jcharArray arr = env->NewCharArray( size );
         env->SetCharArrayRegion( arr, 0, size, ( jchar * ) &( vect[ 0 ] ) );
         return arr;
    }It returns garble to Java instead of the characters put into the vector. What am I doing wrong?

    Presumably you have some reason to think that vect[ 0 ] is going to represent a contigous memory segement for the rest of the characters.
    A java "char" and C "char" are not the same size.

  • Please help me with my code (has conversion from string to int)

    import javax.microedition.midlet.*;
    import javax.microedition.lcdui.*;
    public class Test3 extends MIDlet implements CommandListener
    {   Form mForm;
        Command mCommandQuit;
        Command mCommandItem;
        TextField input,prime1,prime2,prime3,output;
        Display mDisplay;
        int i,j=0,k1,k2,p,q,b;
        //int [] current=new int [1000];
        String mstring,a="";
        String [] temp=new String [1000];
        public void startApp()
        {System.out.println("startApp");
         mForm=new Form("RSA Encryption");
         mCommandQuit=new Command("QUIT",Command.EXIT,0);
         mCommandItem=new Command("ENCRYPT",Command.ITEM,0);
         mForm.append("Enter text:\n");
         input=new TextField(null,"",100, TextField.ANY);
         mForm.append(input);
         mForm.append("Enter first prime number(p):\n");
         prime1=new TextField(null,"",100, TextField.ANY);
         mForm.append(prime1);
         mForm.append("Enter second prime number(q):\n");
         prime2=new TextField(null,"",100, TextField.ANY);
         mForm.append(prime2);
         mForm.append("Enter d:\n");
         prime3=new TextField(null,"",100, TextField.ANY);
         mForm.append(prime3);
         mForm.addCommand(mCommandQuit);
         mForm.addCommand(mCommandItem);
         mDisplay=Display.getDisplay(this);
         mDisplay.setCurrent(mForm);
         mForm.setCommandListener(this);
        public void pauseApp()
        {System.out.println("pauseApp");
        public void destroyApp(boolean unconditional)
        {System.out.println("destroyApp");
        public void commandAction(Command c, Displayable d)
        {System.out.println("commandAction");
         if(c==mCommandQuit)
            notifyDestroyed();
         else if(c==mCommandItem)
         {p = Integer.parseInt(prime1.getString());
             q = Integer.parseInt(prime2.getString());
             b = Integer.parseInt(prime3.getString());
             //breaking up of big string into ints
             mstring=input.getString();
             temp[0]="";
             for(i=1;i<mstring.length();i++)
                {if (mstring.charAt(i) == ' ')
                    {j++;
                     temp[j]="";
                 else
                    {temp[j]=temp[j]+mstring.charAt(i);
             mForm.append("\n\nThe array is:\n");
             for(i=0;i<temp.length && temp!=null;i++)
    {k1=Integer.parseInt(temp[i]); ***********************
    k2=k1;
    for(j=1;j<b;j++)
    {k1=k1*k2;
    k1=k1 %(p*q);
    k2=k1 %(p*q);
    a=a+new Character((char)k2).toString();
    output=new TextField(null,a,100, TextField.ANY);
    mForm.append(output);
    }hi
    this code basically takes an input of string like " 179 84 48 48 155 " (with spaces)
    then it creates smaller strings in an array like "179","84","48","48","155" without the spaces
    then it creates int values 179,84,48,48,155 and finally after some math functions it prints the corresponding letters.
    the problem is that it is not printing the letter because of some exceptions-->java.lang.NumberFormatException .it comes in the line where i have put stars
    could anybody please help me print the letters                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

    thanks for all ur help guys, but me and my team member solved it on our own. here is the new code:
    import javax.microedition.midlet.*;
    import javax.microedition.lcdui.*;
    public class Test3 extends MIDlet implements CommandListener
    {   Form mForm;
        Command mCommandQuit;
        Command mCommandItem;
        TextField input,prime1,prime2,prime3,output;
        Display mDisplay;
        int i,j=0,l,k1,k2,p,q,n,b;
        String mstring,a = "";
        String [] temp=new String [1000];
        public void startApp()
        {System.out.println("startApp");
         mForm=new Form("RSA Encryption");
         mCommandQuit=new Command("QUIT",Command.EXIT,0);
         mCommandItem=new Command("DECRYPT",Command.ITEM,0);
         mForm.append("Enter text:\n");
         input=new TextField(null,"",100, TextField.ANY);
         mForm.append(input);
         mForm.append("Enter first prime number(p):\n");
         prime1=new TextField(null,"",100, TextField.NUMERIC);
         mForm.append(prime1);
         mForm.append("Enter second prime number(q):\n");
         prime2=new TextField(null,"",100, TextField.NUMERIC);
         mForm.append(prime2);
         mForm.append("Enter d:\n");
         prime3=new TextField(null,"",100, TextField.NUMERIC);
         mForm.append(prime3);
         mForm.addCommand(mCommandQuit);
         mForm.addCommand(mCommandItem);
         mDisplay=Display.getDisplay(this);
         mDisplay.setCurrent(mForm);
         mForm.setCommandListener(this);
        public void pauseApp()
        {System.out.println("pauseApp");
        public void destroyApp(boolean unconditional)
        {System.out.println("destroyApp");
        public void commandAction(Command c, Displayable d)
        {System.out.println("commandAction");
         if(c==mCommandQuit)
            notifyDestroyed();
         else if(c==mCommandItem)
         {p = Integer.parseInt(prime1.getString());
             q = Integer.parseInt(prime2.getString());
             b = Integer.parseInt(prime3.getString());
             n=p*q;
             //breaking up of big string into ints
             mstring=input.getString();
             temp[0]="";
             for(i=1;i<mstring.length();i++)
                {if (mstring.charAt(i) == ' ')
                    {j++;
                     temp[j]="";
                 else
                    {temp[j]=temp[j]+mstring.charAt(i);
             l=j;
             mForm.append("\n\nThe result is:\n");
             for(i=0;i<l;i++)
                {k1=Integer.valueOf(temp).intValue();
    k2=k1;
    for(j=1;j<b;j++)
    {k2=k2*k1;
    k2=k2 %n;
    k1=k2 %n;
    a=a+new Character((char)k1).toString();
    output=new TextField(null,a,100, TextField.ANY);
    mForm.append(output);

  • Conversion from string to Date Query.

    Hi,
    I need a way to convert a date format which is in string to a date data type.
    String is in the following format : Tue Feb 27 16:00:31 PST 2007
    Have used the SimpleDateFormat class but it returns an unparseble data error.
    Any thoughts????
    Regards
    Sam W

    Please don't crosspost: http://forum.java.sun.com/thread.jspa?threadID=5142482

  • Conversion from String to int..NumberFormatException??

    Hey all
    I am trying to read in a file that has nothing but numbers listed one per line. I am using the bufferedReader class and reading in by line. When I check to see if the one 'string' is the same as another, it says they are the same, when really they are different. I then thought to convert the numbers to integers after reading them in, but it gives me a number format exception. My process is simple:
    1) line = in.readLine();
    2) int variable = Integer.valueOf(line).intValue();
    This gives me the damn exception. The numbers are three digits, e.g. 333, etc. Does anybody know how I can avert this problem or achieve the result I am looking for another way? All I want is to know what numbers are listed in their, without going through by hand checking. Thanks

    hi...try this..
    1.Use filereader instead of bufferedreader..OKAY
    2. OR USE...
    String str = br.readLine();
    use... int sanjeev = Integer.parseInt(str);
    3 OR...and helloooo one thing more...how u r checking that these 2 strings r same..
    get CLEAR IDEA about equals method and "=="..

  • Conversion from String to Int

    import java.io.*;
    import java.util.*;
    import java.lang.*;
    public static void main(String[] args) throws Exception{
    int Ze=0;
    String Temp = "512";
    Ze = parseInt(Temp);
    I got an error saying --->>
    cannot resolve symbol
    symbol : method parseInt(java.lang.String)
    I tried using ...Integer(Temp)
    and it gives me a similar error message.
    where Did i went wrong???

    http://java.sun.com/j2se/1.5.0/docs/api/index.html
    Bookmark that page. It's the index to the documentation of every class in Java 1.5.0. If you've got a different JDK, look on the download page and find the Documentation. Look for the API documentation in that.
    Go look up the Byte class and see. The API documentation tells every available method for every available class in the java.*, javax.*, and org.* packages. Better start getting used to using it now rather than later.

  • Run time error message - Conversion from string "Mobile Telecommunications" to type 'Boolean' is not valid.

    I get a error message when I select an element in the combo box, please review my variables:
     Public Sector As String
        Public Index As Decimal
    ...and code
     Select Case ComboBox1.Text
                Case "Banks"
                    Sector = "Bank" And Index = -0.086
                Case "Mobile Telecommunications"
                    Sector = "Mobile Telecommunications" And Index = -0.024
                Case "Real Estate Investment Trusts"
                    Sector = "Real Estate Investment Trusts" And Index = 0.132
            End Select

    And is a boolean operator. Try it like this instead:
    Select Case ComboBox1.Text
    Case "Banks"
    Sector = "Bank"
    Index = -0.086
    Case "Mobile Telecommunications"
    Sector = "Mobile Telecommunications"
    Index = -0.024
    Case "Real Estate Investment Trusts"
    Sector = "Real Estate Investment Trusts"
    Index = 0.132
    End Select
    Still lost in code, just at a little higher level.

  • Conversion from string to date

    hi,
    Can someone tell me how can i convert a string "09/09/02" to date ......

    HaHaHa jboeing is Sooo instructional. Yes, please to read instructions, bang head for four hours and then do this -import java.util.*;
    import java.text.*;
    public class DateTest
       public static void main(String[] args)
          String dateStr = "09/09/02";
          Date date = new Date();
          SimpleDateFormat sDF = new SimpleDateFormat("MM/dd/yy");
          try{
             date = sDF.parse(dateStr, new ParsePosition(0));
          }catch(NullPointerException npe)
          {System.out.println("bad parse");}
          java.sql.Date sqlDate = new java.sql.Date(date.getTime());
          System.out.println(date.toString());
          System.out.println(sqlDate.toString());
    }

  • Conversion from u0091Stringu0092 to type u0091Dateu0092

    Hi,
    I am fetching a date from DeliveryDate TextBox from Sales Order. I enter as 10/03/2007. As I need to fetch this value and store it in Production Order DueDate records through SDK Code.When I fetch this value from code,I get as 20070310. When I try to update my Production Order DueDate it gives me an Error Msgbox “Conversion from string “20070310” to type ‘Date’ is not valid.” Here is my code to update production order.
    Dim DelDt As String
    DelDt = MyForm.Items.Item("12").Specific.value
    Here DelDt shows 20070310
    Now I have created an object of ProductionOrder and try to add Records,
    sboProdOrder.DueDate = DelDt
    On the above line it gives me that messagebox.
    Can any one help me as to how can I convert this code in a working one or how to convert the string to date in VB.Net
    Thanks a lot
    Murtaza

    Hi Murtuza,
    Retrieving the value from a date-field through the value always returns the date as a string in the format yyyymmdd.
    the field DueDate is a field of type DateTime.Date. to enter the date in this field, you must convert the string to a date.
    The following line converts the date-string to a date.
    new DateTime.Date(left(DelDt,4), mid(DelDt,5,2), right(DelDt,2))
    Regards
    Ad

  • Struts/ADF/Toplink conversion from 10.1.2 to 10.1.3

    Hi. We have a J2EE application based on Struts/ADF/Toplink.
    We just let the JDeveloper migrate the whole application itself.
    We solved a few minor problems, but now we have the greater one:
    - we have in domain classes some getX...(), setX...() methods, intended for example
    for getting attributes of nested objects or for conversion from String to Date.
    In older version, when you had some getXSomeAtr() method in domain class, the attribute
    XSomeAttr was automatically generated into Data Control.
    In newer version it's not! If you want the attribute to be in data control, you must
    have an private attribute XSomeAtr declared in domain class.
    Example - we have these attibutes (first two has their own getters and setters and are
    mapped in toplink, the third is unmapped)
         private Date datum;
    private String nazev;
    private String XDatumAsDate;
    and methods
    public String getXDatumAsDate() {
    return OurUtils.dateToStringAsDate(getDatum());
    public void setXDatumAsDate(String datum) throws ParseException{
    Date d = OurUtils.StringToDateAsDate(datum);
    setDatum(d);
    And the form look like this
    <html:text property="XDatumAsDate" .../>
    <html:text property="nazev"     .../>
    Reading is ok, but attempt to modify date in input field ends with
    "JBO-35009: Setting attribute for XDatumAsDate in object methodRSICollection failed"
    Are we doing something wrong ? We just need to have the date entering under our control and
    be able to enter dates in various formats.
    Thanks in advance for any comments.

    I compared the both old and new data control xml files and found the difference. The previous attribute descriptor has IsUpdateable="true" but the new has IsUpdateable="0".
    Manually changing won't help - data control generation of any class regenerates all data controls and puts back IsUpdateable="0". I'm stuck now.

  • Conversion from document to string

    I want to perform conversion from document to string for tht purpose i m doing sax parser but in the end i m getting null.The same thing if i do with DOM parser its working fine but some problem with sax parser.
    I am attaching the code if anyone can find the problem it would be gr8.
    Thanks in advance.
    public String DocumentToString(Document doc) {
              StreamResult result = null;
              try {
              SAXParserFactory SAXpf = SAXParserFactory.newInstance();     
    SAXParser SAXparser = SAXpf.newSAXParser();
              XMLr = SAXparser.getXMLReader();
         Source sXML = new SAXSource((InputSource) doc);
    result = new StreamResult(new StringWriter());
    Transformer transformer = TransformerFactory.newInstance().newTransformer();
    transformer.setOutputProperty(OutputKeys.INDENT, "yes");
    transformer.transform(sXML, result);
    catch (TransformerConfigurationException e) {
    e.printStackTrace();
    catch (TransformerException e) {
    e.printStackTrace();
    catch(Exception e)
         System.out.println(e);
    return result.getWriter().toString();
    }

    Paddy,
    There are a couple of ways to create a Word file.  One is to use the Report Generation Toolkit which includes vi's to create and edit Word documents.  Since you are associated with a university you may already have the toolkit.  The other way is to use ActiveX.  You should be able to find examples of both in the forums.  There may also be an example that shipped with LV. 
    Here is one example to get you going http://zone.ni.com/devzone/cda/epd/p/id/992

  • Delete a char from string ?

    Hi,
    I want to delete a char from string. i used the following function.
    String f = formulla.replace('[','');
    The above function doesnt work as it tells me to put a space or some char in 2nd parameter which i dont want. i just want to delete all occurences of some specific char in a string.
    Any suggestion.
    Thanks alot.

    u can do:
    String before;
    char charToReplace;
    StringBuffer tempBuf = new StringBuffer(before);
    for (int i=0; i<tempBuf.length(); i++)
            if (tempBuf.charAt(i)==charToReplace)
                  tempBuf.deleteCharAt(i);
    String after = tempBuf .toString(); HTH
    Yonatan

Maybe you are looking for