CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com

Search:

Type: Posts; User: boburob

Search: Search took 0.04 seconds.

  1. Replies
    10
    Views
    14,217

    Re: Converting String to float

    omg i just realised the problem...i am an idiot! I have been using the wrong variables, sorry for wasting all your time
  2. Replies
    10
    Views
    14,217

    Re: Converting String to float

    Ok apologies, i have been working with swing, and its not showing the stats on swing however they are being uploaded! Im not sure why there not showing up on my swing program though
  3. Replies
    10
    Views
    14,217

    Re: Converting String to float

    Okay, trans1 is definatly holding "6.0"
    Heres my whole project:

    http://cid-3ce0ac785929e198.skydrive.live.com/self.aspx/Public/Blackjackswing.zip

    So have a look yourself guys

    loadFile...
  4. Replies
    10
    Views
    14,217

    Re: Converting String to float

    Ok ive now tried this as well:



    trans1.trim();
    Float f = new Float(trans1);
    winStat = f.floatValue();
  5. Replies
    10
    Views
    14,217

    Re: Converting String to float

    Ok, im not sure i fully understand, ive tried this before:



    Float f = new Float(trans1);
    winStat = f;


    This compiles but winStat remains empty, although trans1 holds the value "6.0"
  6. Replies
    10
    Views
    14,217

    Converting String to float

    Hi everyone.

    I need help again lol, im trying to code a load function, ive got it to read the files and put the values into strings, but i need to convert these to float type and nothing i try...
  7. Replies
    3
    Views
    1,286

    Re: Java swing help!

    Lol ignore my question! Once again im being stupid and forgetting basics!


    if (source == menuStats)
    {
    JOptionPane.showMessageDialog(null, "Statistics\nGames won:" + winCount);
    }

    ...
  8. Replies
    3
    Views
    1,286

    Re: Java swing help!

    Yes you were right, i was kinda trying to copy something straight out of my java book without thinking about it! Instead I just added one panel to another panel:)

    Sorry but I have another...
  9. Replies
    3
    Views
    1,286

    Java swing help!

    Hey everyone, im writing a blackjack program with java swing and im having problems with setting the layout with panels and frames.

    I want to apply a different layout to two different panels, add...
  10. Replies
    5
    Views
    6,651

    Re: Help with swing

    Sorry another quick question, how do i add text to the text area without deleting the rest, eg at the moment im using:


    edit.setText(line);

    Which just puts the last line of text on the...
  11. Replies
    5
    Views
    6,651

    Re: Help with swing

    Thanks alot for your help!
    Completely forgot about moving that one!
  12. Replies
    5
    Views
    6,651

    Help with swing

    Hey ive only been programming java for about a month now and im a little stuck:/

    Basically im making a basic text editor in java, at the moment im trying to load text from a file to a text area...
  13. Replies
    2
    Views
    1,185

    Re: Save and reading .dat file:S

    Thank you for your quick reply:)
  14. Replies
    2
    Views
    1,185

    Save and reading .dat file:S

    Hi, ive been making a blackjack program and current im trying to get it to save and load how much money you have. This is working but it looks like its saving the address of the variable instead of...
  15. Replies
    22
    Views
    1,887

    Re: codebreaking program

    Thank you everyone for your help, it is now working:D
  16. Replies
    22
    Views
    1,887

    Re: codebreaking program

    Lol ok i think now all the changes are made, the let array is working, but its just outputting whatever was in the last position of the decry array



    #include <iostream>
    #include <fstream>...
  17. Replies
    22
    Views
    1,887

    Re: codebreaking program

    Ive made all the changes , hopefully its easier to understand now, both the arrays are working but its only outputting whatevers at the end of the decry array



    #include <iostream>
    #include...
  18. Replies
    22
    Views
    1,887

    Re: codebreaking program

    Sorry im fairly new at c++ so alot of the stuff you said i didnt get:/



    for (int x = 0; x <= 512; x++){
    if (code[x] >= 'a' && code[x] <= 'z') {
    let[code[x]-'a']++;
    }
    }
  19. Replies
    22
    Views
    1,887

    Re: codebreaking program

    Sorry, I had already made all the changes you said before, heres the new code



    #include <iostream>
    #include <fstream>
    //This section of the code includes the libaries needed to run the...
  20. Replies
    22
    Views
    1,887

    Re: codebreaking program

    Yes you were right, the let is working but the decry array is not, i have attatched a screenshot of what happens when its run, the first group of 26 is the let array and the second is the decry array
  21. Replies
    22
    Views
    1,887

    Re: codebreaking program

    Ive changed my program and its running now but this section of code



    for (int x = 0; x <= 512; x++){
    if (code[x] >= 'a' && code[x] <= 'z') {
    let[code[x]-'a']++;
    }
    }
  22. Replies
    22
    Views
    1,887

    Re: codebreaking program

    Oh lol, sorry i was always told to do it like that
  23. Replies
    22
    Views
    1,887

    Re: codebreaking program

    Thanks for your help, ill make the changes now.

    Btw my let[25] array is 25 because an array starts from 0
  24. Replies
    22
    Views
    1,887

    codebreaking program

    Hi, im new to c++ and im trying to make a codebreaking program which works by reading a text file, working out which letter has the highest frequency and swapping it with e, etc.

    Except i cant...
Results 1 to 24 of 24





Click Here to Expand Forum to Full Width

Featured