Programming problems with INT / FLOAT

I got a problem with datatypes float and int.
I'm just developing a c-program on HP-UX with the gcc-compiler. 'cause i have not ever been done an ORACLE-access before, i has started with the "cdemo2.c" - example from the oracle-demo-dircetory in version 8.0.4.
in the DB there's a column with NUMBER-TYPE, but when i call the oci-function (or what ever it is) "odescr()", the variable "scale" (which is supposed to differentiate between FLOAT_TYPE and INT_TYPE) always is set to "0". this variable should be set to anything else but "0" if a FLOAT_TYPE is detected, but it isn't.
what I do wrong ???
How can I know the exact datatype, when a NUMBER_TYPE in the DB appears ???
if there is a better way to realize an oracle-access in C, please don't wait to tell it to me
many thanks
null

You basically got it. Another approach is to always work on the rightmost digit; that way you'll always be dividing, mod'ing, or multiplying by 10.
You don't need to know the length of anything to use a for loop. Remember that a for loop has 4 parts: the initialization, the conditional, the "update", and the body. (There are probably more correct names for these that I can't recall right now.) The conditional and the update tend to be length checks and increments only because for loops are commonly used over arrays or strings, but they don't have to be.
Another hint: how do you know when you're done pulling the digits out of the source number? What is the value of the source number when you're done?

Similar Messages

  • Problems with the floating lens.

    Hello Nokia,
    My Lumia 920 has a very wierd problem with the floating lens. When I tilt the device up it blurrs the image for a sec or two and it makes a squirk sound which also records on the footage.
    Here is a video made with my Lumia 920.
    http://youtu.be/jlzzOBlAT6Q
    I sent my phone for a replacement, but I just wanted to let you know that this could happen and maybe stimulate those little chinese people in your factories to do a better job.

    Hello Nokia,
    My Lumia 920 has a very wierd problem with the floating lens. When I tilt the device up it blurrs the image for a sec or two and it makes a squirk sound which also records on the footage.
    Here is a video made with my Lumia 920.
    http://youtu.be/jlzzOBlAT6Q
    I sent my phone for a replacement, but I just wanted to let you know that this could happen and maybe stimulate those little chinese people in your factories to do a better job.

  • Problem with TLF - floating an inline image

    I am running the latest version of Flash Builder 4 (4.0.1).  The problem that I having:
    When I use an InlineGraphicsElement if aTextFlow (in a RichEditableText component), if I set a value for the "float" attribute of an <img> element; the image is not visible.  Without the float attribute, I see the image.
    Is this a version problem with TLF?  How do I know which version of TLF that I'm using?  How do I install the correct version of TLF?
    Thanks for the help.
         Oz
    Some code fragments:
    The TextFlow string with "float":
    <div color="#444444" fontFamily="Times New Roman" fontSize="20" paragraphSpaceAfter="15" textIndent="10">
    <p><span color="0xff0000" >Alice, </span><span>really, was </span><span color="0xff0000" >beginning </span><span>to </span><span color="0xff00" >get very </span><span>tired of </span><span color="0xff00" >sitting </span><span>by her </span><span color="0xff00" >sister </span><span>on the </span><span color="0xff00" >bank, </span><span>and of </span><span color="0xff00" >having nothing </span><span>to do:  once or twice she had peeped into the book her </span><span color="0xff00" >sister </span><span>was reading, but it had no </span><span color="0x888800" >pictures </span><span>or </span><span color="0xffff" >conversations </span><span>in it, `and what is the use of a book,' thought </span><span color="0xff0000" >Alice `</span><span>without </span><span color="0x888800" >pictures </span><span>or </span><span color="0xff00" >conversation?'</span></p>
    <p>
    <img float="left" width="100" source="assets/library/alice/images/White Rabbit.png" height="100"/>
    <span>So she was </span><span color="0xffff" >considering </span><span>in her own mind</span><span>(</span><span>as well as she could, for the hot day made her feel </span><span color="0xff00" >very </span><span>sleepy and stupid), whether the pleasure of making a daisy-chain would be </span><span color="0x880000" >worth </span><span>the trouble of getting up and picking the daisies, when suddenly a White </span><span color="0xff00" >Rabbit </span><span>with pink eyes ran close by her.</span></p>
    </div>
    Without "float":
    <div color="#444444" fontFamily="Times New Roman" fontSize="20" paragraphSpaceAfter="15" textIndent="10">
    <p><span color="0xff0000" >Alice, </span><span>really, was </span><span color="0xff0000" >beginning </span><span>to </span><span color="0xff00" >get very </span><span>tired of </span><span color="0xff00" >sitting </span><span>by her </span><span color="0xff00" >sister </span><span>on the </span><span color="0xff00" >bank, </span><span>and of </span><span color="0xff00" >having nothing </span><span>to do:  once or twice she had peeped into the book her </span><span color="0xff00" >sister </span><span>was reading, but it had no </span><span color="0x888800" >pictures </span><span>or </span><span color="0xffff" >conversations </span><span>in it, `and what is the use of a book,' thought </span><span color="0xff0000" >Alice `</span><span>without </span><span color="0x888800" >pictures </span><span>or </span><span color="0xff00" >conversation?'</span></p>
    <p>
    <img width="100" source="assets/library/alice/images/White Rabbit.png" height="100"/>
    <span>So she was </span><span color="0xffff" >considering </span><span>in her own mind</span><span>(</span><span>as well as she could, for the hot day made her feel </span><span color="0xff00" >very </span><span>sleepy and stupid), whether the pleasure of making a daisy-chain would be </span><span color="0x880000" >worth </span><span>the trouble of getting up and picking the daisies, when suddenly a White </span><span color="0xff00" >Rabbit </span><span>with pink eyes ran close by her.</span></p>
    </div>
    A bit of MXML code:
        <s:Group id="myGroup" width="100%" height="100%">
            <s:RichEditableText id="myRichText" lineBreak="toFit">
            </s:RichEditableText>
            <!--- Do not set the height of the RichEditableText - since it seems to prevent the appearance of the vertical scroll bars -->
        </s:Group>
    And some Actionscript that adds components:
                scroller = new SxScroller();
                scroller.dx = dxScroller;
                scroller.dy = dyScroller;
                scroller.addEventListener(FlexEvent.CREATION_COMPLETE,scrollerEvent);
                scroller.addEventListener(FlexEvent.UPDATE_COMPLETE,scrollerEvent);
                richText = scroller.richText;
                richText.editable = false;  // textCharacter.enableEdit; // probably false.  TODO:  support true???
                richText.selectable = true; // required
                richText.width = dxRichText;
    And finally the import of a TextFlow string:
    richText.textFlow = TextFlowUtil.importFromString(textFlowString, WhiteSpaceCollapse.PRESERVE);

    On the TextFlow forum I found the answer:
    Use Flash Builder Hero, since it support TLF 2.0 out-of-the-box.  The InlineGraphics support several valuable attributes, including float="left" etc.
    Beautiful.

  • PPC program problem with MacPro

    Hello all.
    Suddenly all my PPC programs stopped working on the MacPro.
    I have tried standard diskcheck and repair permissions on my boot harddrive.
    I have 4 different PPC program: Windows Media Player, Photoshop, MS Office and cannon scangear. All stopped working.
    It seems to be a problem with the PPC emulation.
    Any idea what I should do? Do I really need to reinstall my mac? It feels like Windows all over...
    Kind regards Mau
    MacPro 3ghz   Mac OS X (10.4.8)  

    I did download the full 10.48 update an installed. It still does not work.
    I am not shure what cused the problem. Had issus with that my root filesystem was full. It was /var/spool/qmaster that was filled with junk data.
    I could not delete the useless data in that directory. it took 50% of my harddriva space.
    I logged in as root and pwd to /var/spool/qmaster and the directory name of my qmaster que. Lets call it buhu.
    cd /var/spool/qmaster/buhu.
    To delete the data. The wonderful command:
    rm -rf *
    My computer works great, but no rosetta programs anymore. It worked since I got my Macpro in Aug.
    Thanks all for the help, and sorry for my shaky enlish.
    The 1049 update should have som rosetta updates. My problems could be solved with it?
    I am desperate and thinking about installing a beta build of 10.49.

  • HR Programming :  Problem with IDOC HRMD_A

    Hello ,
    We use Idoc HRMD_A for transferring PA records from
    one R3 system (ECC5) to another R3 system (46d).
    We have a problem - The Idoc doesn't check the data
    inserted against the database check tables and
    inserts wrong values into the target system database.
    (At least that what has happened when we transferred
    wrong value of MASSN in 0000 records).
    Is there something we can do ?
    Maybe - Some flag we can sign in order a check against check tables will be done ?
    Is it a problem with this IDOC ?
    Thanks .
    I appreciate any help.
    Nitzan S.

    Consultancy note 134085 :
    "Ultimately you are responsible for consistency of this data. SAP saves this data directly on the database without checking the single fields and consistency of the data records (time constraints check, writing change pointers, value check) because the consistency for an R/3 - R/3 lingage is of course ensured."
    The IDOCs were intended for R3->R3 data replication, and not for data loads/interfacing. Since you're having problems, I'm guessing in addition they require the same SAP version as well.

  • \t problem with int

    I have a question about the \t escape sequence. I am still learning but I can get it to work just fine in literal strings then when I try to use it with an int I keep getting illegal character \92. Here is what I am trying to do
    class Display
    public static void main(String args[])
    int x = 5;
    System.out.println("Number\tIts Double\tIts Triple");
    System.out.println(x\t(x*2)\t(x*3);
    x = x + 1;
    System.out.println(x\t(x*2)\t(x*3);
    So I am trying to a x, x's and x's triple to print but keep getting illegal character \92 coming up when I go to compile. Please help me figure this problem out as I have tried everything I can think of. Thanks for your help in advance

    System.out.println(x\t(x*2)\t(x*3);WFT? \t only has meaning within a String!
    try something like this
    System.out.println("x\t(x*2)\t(x*3) = "+x+"\t("+(x*2)+")\t("+(x*3));

  • Problem with a float atribute

    I have a problem when I try to divide 2 integer:
    int a = 854;
    int b = 1000;
    float c = a/b;
    and the response is c = 0;
    How can I get the response c = 0.854;
    Thank you,
    aclaudia1

    thanks,
    it works

  • Automatic Payment Program-problems with check printing/viewing

    Hello:
    I am new to the SAP field. I have been trying to make the automatic payment program work for me. I have been having trouble trying to view the print preview of checks by going to system->own spool requests.
    Steps followed ---Automatic Payment Program:
    I checked the open invoices -
    FBL1N
    I ran F110 and finally print out with the start immediately option checked
    I checked the open invoices FBL1N again and all the open invoices have cleared
    However I am unable to view the checks that should have printed for this payment run. Can anyone please tell me what I am doing wrong here.
    Thanks,
    Mahesh

    Mahesh,
    Go to F110, Enter the run date and then click enter - After that click on edit and then proposal and proposal list and you can see all the details - which actually runs the program RFZALI20.
    Hope that helps..
    Thanks,
    Nandita

  • Quering Problem With Int

    my jsp file is :
    <jsp:useBean id="user" class="com.mycompany.DelData" scope="page"/>
    <HTML>
    <BODY>
    <b>
    Your Data Deleted<BR>
    <% user.del(); %>
    </BODY>
    </HTML> And the DelData.java file is:
    package com.mycompany;
    import java.sql.*;
    public class DelData {
    public void del() {
    try{
    Class.forName("oracle.jdbc.OracleDriver");
    Connection conn = DriverManager.getConnection ("jdbc:oracle:thin:@.......:o9ir2","user1", "user1");
    Statement stmt = conn.createStatement();
    PreparedStatement p_stmt = null;
    int num = 1010;
    p_stmt = conn.prepareStatement("delete from trainee where univ_reg = 1011");
    int rs = p_stmt.executeUpdate();
    p_stmt.close();
    conn.close();
    } catch (Exception e) {
    System.err.println("Got an exception! " + e);
    System.err.println(e.getMessage());
    } I am able to delete string value but not able to delete integer values
    also while quering if i use string as a condition it executing but not in the case of int.
    I had also try this with PreparedStatement But Same result.
    Help Me !!!
    Its working with string values but not with integer values

    int num = 1010;
    p_stmt = conn.prepareStatement("delete from trainee where univ_reg =?);
    p_stmt.setInt(1,num);
    int updateCount = p_stmt.executeUpdate();

  • A Programming problem with PXI 8461

      I use PXI-8461 CAN Card.
      The subvi READ_AI's function is to aquire data,and save datas to database.
      And Process.vi dynamicly calls READ_AI twice,and a Main.vi calls Process.vi for every step.
      Every step lasts 10 seconds,and has 10 seconds interval.
      step1: from 0s->10s, aquire data;
             delay 10s;
      step2: from 20s->30s,aquire data;
      I find that ,step2's data is from 10s->30s!
      What is the problem ? Is there any error in CAN's use ?
      Here is my vi. thank you.
    Attachments:
    READ_AI.vi ‏80 KB
    Process.vi ‏44 KB

    It displayed that error message because it reached the end of the file before your program was complete. For example, remember when last Thursday when you
    Hey, did you notice how the last sentence up there just stopped before the sentence was really done? Your program does the same thing.
    Read some tutorials about Java; they'll have plenty of examples of complete programs.

  • I can't use my adobe programs, problem with license?

    I had a totalt computer crash wich resulted in a new installation of my OS. I had my backup-HD were i copied my Adobe program from into my reinstalled computer, but now I cant use them because "they are copies" (I have payed for them) I can't even reinstall them.  How can I solve this problem?

    Nobody can tell you anything without proper system info or other technical details.
    Mylenium

  • Programming problem with Generics

    Hello all...
    I'm trying to get a class using generics. This class is a generic Parser. Here is a piece of code:
    package com.parser;
    import java.io.StringReader;
    public class Parser<T> {
         private Class<T> constructedClass= null;
            String myString= null;
         public Parser(Class<T> class, String str;) {
              constructedClass= class;
                    myString= str;
         public T parse(String document)
              throws JAXBException, ClassNotFoundException {
              ConstructedClasscc = ConstructedClass.newInstance(constructedClass.getPackage().getName());
              Transformer u = cc.getTransformer ();
              return ConstructedClass.cast(u.transform(myString);
    }This code is working now, but I need include Class<T> parameter in the constructor in order to get the name of the package.
    I've tried to clear this constructor, but i'm not able to find any trick to avoid the: constructedClass.getPackage().getName()* line without constructedClass param.
    Does exist any method to obtain it?
    Thankyou all in advance.

    No, erasure means that generics information like that isn't available at run time. it's quite common for generic classes to take the actual class as a parameter for that reason (see, for example, the EnumMap constructor.)

  • Dialog Programming: Problem with Radio Buttons in a dialog screen.

    Removed - Duplicate posting.
    Edited by: miniSAP on May 14, 2009 9:05 AM

    Hi,
    go to se51 screen layou and select the four radio button and right click there is a option called assigned group name..
    enter the group name..
    from now onwards it allows you to select only one radio button at a time..
    Regards,
    Prabhudas

  • CSS problem with the clear property

    This is my actual page
    http://www.martcol.co.uk/abba/
    and I want to swap the paragraphs around. This is what I come up
    with
    http://www.martcol.co.uk/abba/test/test01.php
    I reckon I am getting muddle with the whole clearing the
    float thing.
    Many thanks
    Martin
    Actually, I think it only breaks up in Firefox - bear in mind
    I only tested in IE6 and FF

    http://martcol.co.uk/abba/pages/patch.php
    Oh dear, another problem with my floated elements and the
    clear property....
    Martin
    I think I have this now. Not sure why but picking away at it
    has it fixed.

  • I have a little problem with input in my program...(System.in, BufferedRead

    I'm coding a program that takes a input like this :
    Sample Input
    1 11 5
    2 6 7
    3 13 9
    12 7 16
    14 3 25
    19 18 22
    23 13 29
    24 4 28
    So I wrote a code like this :
    public static void main(String[] args) throws Exception{
              BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
              String input = null;
                   while((input = br.readLine()) != null) {
                   StringTokenizer st = new StringTokenizer(input);
                   int leftX = Integer.parseInt(st.nextToken());
                   int height = Integer.parseInt(st .nextToken());
                   int rightX = Integer.parseInt(st.nextToken());
    .... rest of the code....
    But unlike I expected, the program did not pass the while loop.
    When I observed in debugging mode, when "br.readLine()" has no more strings to read,
    the whole program just becomes idle doing nothing, and it does not proceed further.
    Is there any problem with my code there? I've been trying to figure it out for hours... Please help!!!

    myunghajang wrote:
    Why doesn't it work in a way I intended? BufferedReader returns null if there is no more string to read, and what's the problem?
    It's so frustrating...The computer doesn't have a mind reading input, how is your program supposed to know you have finished typing the input?
    If you put the data in a file and redirect it into your program on the command line it will work (because the file knows where its end is)
    Your program could instead assume that a blank line is you end of input.

Maybe you are looking for