Search:

Type: Posts; User: civix

Page 1 of 20 1 2 3 4

Search: Search took 0.02 seconds.

  1. Sorry for the long bump. I've been deployed. ...

    Sorry for the long bump. I've been deployed.

    As for the buffer overflow situation:



    stringstream ss(str);
    int x;
    ss >> x;
  2. Couple of small questions. Buffer overflow and passing variables through functions?

    Just a couple small ones that I couldn't seem to find solid answers to via either this message board or Google.

    First of all, I've got a simple numbered menu utilizing an integer for user input...
  3. Perhaps they wanted the code?

    Perhaps they wanted the code?
  4. Modified your code a little bit to put an...

    Modified your code a little bit to put an increment on verify and told the ofstream to accept an argument from checkstatus, that way I can use the function for multiple items, as I'm sure it's pretty...
  5. I'll change the output filestream to accept the...

    I'll change the output filestream to accept the argument from changestatus.

    EDIT: Did that, nothing changed.
  6. He means that you should be bracketing your if...

    He means that you should be bracketing your if statements with these things:



    if(condition)
    {
    cout<<"result\n";
    }
    else
    {
  7. That code appends: linenumber = 1 g_godmode =...

    That code appends:

    linenumber = 1
    g_godmode = 1

    in diff_easy.cfg.

    That happened with g_godmode already in the file so as to be removed.

    If you think it would help, I could zip up a...
  8. Yes. I moved the break to after the filestream...

    Yes. I moved the break to after the filestream closes so as to allow the code to execute, but stop it before it executes an infinite number of times.

    The only remaining issue is that the else code...
  9. Okay, now I've got offswitch working properly...

    Okay, now I've got offswitch working properly when called from changestatus, and added the filestream to add the string to the file should it not be present, but the else code is now not executing....
  10. Offswitch is being called from changestatus....

    Offswitch is being called from changestatus. Fixed the OP.

    Would moving the entire if statement outside the loop help, or would it just complicate things?
  11. Issues calling a function from within a function.

    Currently having some issues with these two functions. Offswitch works as intended when called by itself, but does not function when called from changestatus.



    int offswitch(string arg3);
    int...
  12. Thanks for the tip, that makes alot of sense. ...

    Thanks for the tip, that makes alot of sense.
    Modified my code. :)
  13. Got everything settled and converted to a...

    Got everything settled and converted to a function.



    int searchtxt(string arg1)
    {
    int linenumber = 0;
    ifstream check ( "C:\\Program Files (x86)\\Electronic...
  14. Made a bit of progress using this: ...

    Made a bit of progress using this:



    ifstream choice_one_op_in ( "C:\\Program Files (x86)\\Electronic Arts\\Crytek\\Crysis\\Game\\Config\\diff_easy.cfg", ios::in);
  15. The issue is that it just doesn't work. It...

    The issue is that it just doesn't work. It produces no results.

    I know I'm missing something, as tonight is the first time I've picked up a compiler in at least a couple of years.

    Can you give...
  16. Problem searching for a string in a text file. Help?

    Alright, I've been searching and digging through threads for a couple of hours now, and haven't really found anything I can use/understand.



    ifstream choice_one_op_in ( "C:\\Program Files...
  17. Replies
    2
    Views
    942

    Wow. Cant believe I didnt think of that before....

    Wow. Cant believe I didnt think of that before. Thanks.
  18. Replies
    2
    Views
    942

    Need help formatting data from a text file.

    Alright, so here's what I have:



    ifstream op1appt;
    op1appt.open("op1appts.txt");
    if(!op1appt.is_open())
    ...
  19. Wow. Thats just ridiculously simple. Thanks alot...

    Wow. Thats just ridiculously simple. Thanks alot for the help and tips, Mike.
  20. Resetting random numbers on the same variable...

    Alright, so im storing a random number to a variable using the GetRand function from the tutorial. What im wanting to do is get a different random number assigned to that variable..



    #include...
  21. File path is good. I've already checked it like...

    File path is good. I've already checked it like five times. Haha.

    EDIT: Turns out that the file was set to read-only.

    Now its returning what looks like a memory address. wtf?

    EDITx2:...
  22. Agh. Yet another newbie trying to read from a TXT.

    Alright, I hate to ask this, because I know its been asked hundreds of times before, but I could not come up with anything really useful in a search. I'm trying to read a string from a text file, but...
  23. Generating a random number in a specified range and storing to a variable...

    Alright, here's another one for you guys thats got me absolutely stumped.



    #include <stdio.h>
    #include <iostream.h>

    #include <stdlib.h>
  24. Replies
    8
    Views
    1,540

    Eh, its actually a console program that accepts...

    Eh, its actually a console program that accepts command-line arguments- File shredder.

    I wound up using sprintf() and a system call to do the job.

    Thanks for your time.
  25. Replies
    8
    Views
    1,540

    Permanently deleting a file

    Okay, so right now im using the remove() function thats in stdio. The problem with that is that the file to be deleted is being moved to the recycle bin. I need to to be deleted permanently, as if...
Results 1 to 25 of 500
Page 1 of 20 1 2 3 4