Search:

Type: Posts; User: nick753

Page 1 of 5 1 2 3 4

Search: Search took 0.01 seconds.

  1. Replies
    1
    Views
    4,532

    C++ XML file editing

    I am a c++ noob who is still learning things like structs and classes. However, I want to write a simple program that makes a small change to an XML file. I've googled the matter a little bit, but...
  2. Replies
    7
    Views
    1,273

    Shouldn't it just be char output[] ?

    Shouldn't it just be char output[] ?
  3. I think my version is much easier, thanks for...

    I think my version is much easier, thanks for trying to help though!


    void remove(char cstring[], char letter)
    {
    int j = 0;
    int i ;

    for( i = 0; cstring[i] != '\0'; i++ )
    {
  4. I just can't get it, how can I push back all of...

    I just can't get it, how can I push back all of the characters after the space of the removed characters? I tried finding it in my book, and there is nothing like that. I tried looking online and...
  5. How would I copy the next valid character to a...

    How would I copy the next valid character to a specific spot?
  6. By replacing them with their neighbors you mean...

    By replacing them with their neighbors you mean pushing back all the characters after the space that were left? And I would do this with the 2nd char array?
  7. Here is my attempt at doing that, but it is...

    Here is my attempt at doing that, but it is giving me spaces where the letter used to be when I cout the 2nd array.

    for(int i = 0; cstring[i] != '\0'; i++)
    {
    if(cstring[i] !=...
  8. Isn't there a way that I can store all of the...

    Isn't there a way that I can store all of the letters that are != to letter into another char array? That is what I was hoping to do with strcpy.
  9. I have been trying to create an algorithm for...

    I have been trying to create an algorithm for about 3 hours now and nothing I do works. I don't know what to do.
  10. should I set last to strlen? Like this last =...

    should I set last to strlen? Like this

    last = strlen(cstring)

    ??
  11. This will work with the way my program is set up...

    This will work with the way my program is set up now? Also, this will work if I have to delete character 4, 5, and 11?
  12. Can you give me some idea how to do that?

    Can you give me some idea how to do that?
  13. I got it to work like this void remove(char...

    I got it to work like this
    void remove(char cstring[], char letter)
    {
    char cstring2[55];

    for(int i = 0; cstring[i] != '\0'; i++)
    {

    if(cstring[i] != letter) cout << cstring[i];
  14. How do I remove a character from character array?

    I am tryin gto make a program that allows the user to enter a string as a character array and a letter to delete from the array. I am having a very hard time deleting the letter from the array. The...
  15. Replies
    8
    Views
    1,073

    He says he doesn't have a compiler yet guys,...

    He says he doesn't have a compiler yet guys, jeez. He just wants someone to explain why the else will be executed.

    Anyway, the else will be executed if the two values are equal because the if...
  16. Replies
    7
    Views
    1,971

    Ok now how is the i%j logic working? Say i is 4,...

    Ok now how is the i%j logic working? Say i is 4, then j would be 3 right? 4%3 does not equal 0 right? And when i is 6, wouldn't j be 5? Then 6%5 would not equal 0 either? What am I missing?
  17. Replies
    7
    Views
    1,971

    So how does the inner loop ever first get...

    So how does the inner loop ever first get executed since i and j are both set to 2? Does the outer loop get executed first, then the inner loop starts? I just don't understand how the inner loop...
  18. Replies
    7
    Views
    1,971

    C++ prime number questions

    I came across this code to find prime numbers and I don't quite understand the nested for loop. Can someone explain exactly how it works? If i and j both = 2, then how does j increment when j < i...
  19. Was this to me or nimitzhunter?:confused: Now...

    Was this to me or nimitzhunter?:confused: Now I'm getting even more confused!
  20. Okay, but is there a obvious reason as to why my...

    Okay, but is there a obvious reason as to why my method is not working? To just take the last card dealt and put it at the end of the array then decrement the pointer down one each time a card is...
  21. Do you mean fill the array with the random...

    Do you mean fill the array with the random numbers? That's not really what I am supposed to do. I am supposed to fill the array from 0-51 then add the randomness when I deal the card. Then after...
  22. No matter what I try NOTHING seems to work when...

    No matter what I try NOTHING seems to work when it comes to trying to making my program not deal the same card twice! I am hoping someone can point me to the right direction with this! The first way...
  23. Okay, I think I got this working pretty much like...

    Okay, I think I got this working pretty much like it's supposed to. The one thing that is sort of stumping me, however, is the shuffle function. To shuffle, I was thinking of just allowing all of...
  24. Replies
    5
    Views
    1,499

    Jeez, you guys always find something to pick at. ...

    Jeez, you guys always find something to pick at. Who gives a flying .......... if I have a brace not indented while trying to help out a new programmer!!? The point was to show him how a loop could...
  25. Replies
    5
    Views
    1,499

    Wow, that sure is a lot of code to do a simple...

    Wow, that sure is a lot of code to do a simple task! Have you learned about loops yet? You can loop the output and input so you won't need the if statements and other code.

    Check this out


    ...
Results 1 to 25 of 121
Page 1 of 5 1 2 3 4