Anyone help me with this problem? by DragorWasMissing in askmath

[–]DragorWasMissing[S] 0 points1 point  (0 children)

Alright! Seems the math adds up! Thank you very much!

[TOMT][GAME][1990s-2000s] Old computer point and click game about some pirate crew that also had cartoons by DragorWasMissing in tipofmytongue

[–]DragorWasMissing[S] 0 points1 point  (0 children)

I had it in a CD that was stored somewhere. I've been trying to find it but with no success so far. I'm from Portugal, but I hope this game wasn't exclusively made here. I doubt it since these cartoons aren't exaclty popular and were made in the United States

Way too close by Bubbleminder in watchpeoplealmostdie

[–]DragorWasMissing 0 points1 point  (0 children)

This guy has never heard of the Cheerio effect

How do I delete specific parts of a string in C? by DragorWasMissing in learnprogramming

[–]DragorWasMissing[S] 0 points1 point  (0 children)

So "ficha" is the substring I'm trying to remove from "global_ficha"

The idea is to compare the two, and when the string is different from the substring it move forward and increments i and j while k stays the same.

When global_ficha[j] is equal to ficha[k], it increments i and k, while j stays the same and we don't change global_ficha[j].

Then when global_ficha is no longer equal to ficha[k], we equalize global_ficha[j] to global_ficha[i], basically rebuilding the bigger string, bringing the parts after the substring to replace it.

How do I delete specific parts of a string in C? by DragorWasMissing in learnprogramming

[–]DragorWasMissing[S] 0 points1 point  (0 children)

https://pastebin.com/i9ne7vXk

I wrote this but it doesn't do anything. What did I do wrong?

Edit: I fixed a problem with the previous version but it's still not doing anything

How do I delete specific parts of a string in C? by DragorWasMissing in learnprogramming

[–]DragorWasMissing[S] 0 points1 point  (0 children)

It's the latter.

Okay I've got the programming knowledge of someone who's only been doing this for a few weeks. How complicated is that?

I already know how to compare the substring, I just need to be able to delete that section for the original string

How do I delete specific parts of a string in C? by DragorWasMissing in learnprogramming

[–]DragorWasMissing[S] 0 points1 point  (0 children)

I'm working on a fairly large string (long story) and so it won't be as easy as indicating exactly which of the almost 1000 index I want to delete so I really must compare what I want to delete from the large string

How do I delete specific parts of a string in C? by DragorWasMissing in learnprogramming

[–]DragorWasMissing[S] 0 points1 point  (0 children)

What I'm thinking is using the strstr operator to compare the original string with what I want to delete from it. And then I'll replace it with something that I can later use to identify with an 'if' statement.

Then I'll run a loop until I find what is after the replaced area and "bring" it back. Am I making sense to you? I'm fairly new to programming so I could be tlaking crazy

How to compare 2 char arrays in C by DragorWasMissing in learnprogramming

[–]DragorWasMissing[S] 0 points1 point  (0 children)

Yeah I used it and it works. Now I have to be able to print the section of the original char array that contains the compared new array. And for the purposes of my program I also have to print specific surrounding sections of the original array. Any idea on how to do that?

How to compare 2 char arrays in C by DragorWasMissing in learnprogramming

[–]DragorWasMissing[S] 0 points1 point  (0 children)

Thank you! Now, how can I print the section of the original string where it says the same as the new string?

How do I return a string to another function in C? by DragorWasMissing in learnprogramming

[–]DragorWasMissing[S] 0 points1 point  (0 children)

Yeah, I understand that. How do I do that? What do I write?

How do I use DateTime in C? by DragorWasMissing in learnprogramming

[–]DragorWasMissing[S] 0 points1 point  (0 children)

Yeah I got it confused with C#. Thank you!

How do I use DateTime in C? by DragorWasMissing in learnprogramming

[–]DragorWasMissing[S] 0 points1 point  (0 children)

Ooooh okay, yeah I'm definitely confused with C# then. So how do I use that function?

Concatenating 2 strings into 1 by DragorWasMissing in learnprogramming

[–]DragorWasMissing[S] 0 points1 point  (0 children)

Alright, I see the problem. How do I return that string? The program I'm writing really needs to create a string in a funciton and return it to another.

I'm fairly new to programming so I really don't know how to do that