Search:

Type: Posts; User: rkrajnov

Search: Search took 0.01 seconds.

  1. Replies
    8
    Views
    2,288

    Very easy issue with strstr

    Hi I have a piece of code that's supposed to find and change all instances of words in a sentence. Here's what it pretty much looks like:



    while(replace = strstr (p, from)){
    while(*to){...
  2. Replies
    18
    Views
    1,618

    Good call. that probably was whats wrong. not...

    Good call. that probably was whats wrong. not gonna bother messing with it now though cause it works how I have it.
  3. Replies
    18
    Views
    1,618

    Figured it out! needed to be read in like this...

    Figured it out!

    needed to be read in like this
    %s %s %[^\n]

    Thanks for the help guys. you definitely got me on the right track.
  4. Replies
    18
    Views
    1,618

    unfortunately I tried that and it results in a...

    unfortunately I tried that and it results in a segmentation fault as well.
  5. Replies
    18
    Views
    1,618

    Here's the main relevant method. It gets a string...

    Here's the main relevant method. It gets a string response through a program given to us. The sendCommand method outputs into response (so response has right output no questions asked). Then I...
  6. Replies
    18
    Views
    1,618

    What do you mean by stripping line feeds.......

    What do you mean by stripping line feeds.... there definitely is a trailing line feed. Take a look at my initial post and you can see what the input is (note it could be 3, 4, 5+ lines as well).
  7. Replies
    18
    Views
    1,618

    No, it definitely is valid right there. It's...

    No, it definitely is valid right there. It's defined just before this segment of code all in the very same method. I'm 99% sure the problem is in something I wrote out 2 posts ago. I just don't know...
  8. Replies
    18
    Views
    1,618

    Ok I will check it out and that's not the case....

    Ok I will check it out and that's not the case. Response is defined in the rest of my code. I've tested it to make sure response is ok. I can print off response fine with no segmentation error and...
  9. Replies
    18
    Views
    1,618

    Here's what I just tried, but its giving me a...

    Here's what I just tried, but its giving me a segmentation fault. i have a feeling it might have to do with my misunderstanding of what %[^\n] is doing

    (response is the string)
    char str [100];...
  10. Replies
    18
    Views
    1,618

    That makes sense, but what exactly is the %[^\n]...

    That makes sense, but what exactly is the %[^\n] doing?
  11. Replies
    18
    Views
    1,618

    Help with string formatting problem...

    Ok so I've got a kind of weird question

    I need to take output such as:
    "12 Spiderman message goes here\n
    13 Superman message goes here"

    And reformat it like
    12: Spiderman - message goes here...
  12. Problem with beginner code... please help

    Ok so I'm making this program and its pretty much just converting from one base number to another (i.e. base 16 to base 10[normal]). Anyhow, that's not really important, what is is that my program is...
Results 1 to 12 of 12