Help with C programming.

1 Name: Anonymous 2021-10-15 04:43
I need help with my C programming course (I have no reference to double-check what's wrong with my code). Would appreciate any help I could get.
2 Name: Anonymous 2021-10-15 06:58
Post it, I may be able to figure it out.
3 Name: Anonymous 2021-10-15 08:38
why the fuck would you post this question without any fucking data retard

drop the code and content so somebody reads this shit and answers the actual question instead of wasting the time of autists who read this shit
4 Name: Anonymous 2021-10-15 09:45
The code is supposed to check if a substring is in included in the original string.
5 Name: Anonymous 2021-10-15 10:52
I forgot uploaded the link to image :(
6 Name: Anonymous 2021-10-15 12:33
that is one fucked up way to layout code.
Never heard of the tab key?
7 Name: Anonymous 2021-10-15 13:23
jesus christ, nevermind, i don't have the mental capacity for that

please use clang-format and IDE that has reasonable debugger support, like Visual Studio or CLion or VSCode or whatever the fuck else
8 Name: Anonymous 2021-10-15 16:43
condensed the layout for the screenshot
9 Name: Anonymous 2021-10-15 19:30
int i;
int j;
This really fucking triggers me, why do people get taught it's ok ot us i and j as variable names? Get into the habit of self-documenting variable names like stringIndex0 and stringIndex1 instead of i and j. I know i and j are kind of accepted lazy standards, doesn't mean you shouldn't get into good habits early.

And indent your code if you want people to debug it for you.
10 Name: Anonymous 2021-10-15 22:50
Fucking hated learning code at uni and having to always go back and remind myself which letter applied to which physical variable
11 Name: Anonymous 2021-10-16 02:44
Might as well drop out now and apply to the nearest Walmart
12 Name: Anonymous 2021-10-16 02:59
Pretty sure putting semicolons after your for loop wont let it enter the braces.

Should look like:
If count == substr.length
13 Name: Anonymous 2021-10-16 04:41
14 Name: Anonymous 2021-10-16 06:04
Pretty sure putting semicolons after your for loop wont let it enter the braces.

hadnt noticed that. yeah that's why I was taught to write:
indented items;

clarity and brackets all in one line.
15 Name: SFBEkills 2021-10-16 07:28
This thread is fun
16 Name: Anonymous 2021-10-16 08:51
try working with indian programmers who name everything x, y and z and occasionally "temp", fucking wankers
17 Name: Anonymous 2021-10-16 10:15
for (j=0; j<=strlen(substr); j++);

WTF is the purpose of that loop? That whole loop can simply be replaced by "j = strlen(substr)+1;".
18 Name: Anonymous 2021-10-16 11:39
your mom is fun
19 Name: Anonymous 2021-10-16 12:29
Altered it. Same shitty output.
20 Name: Anonymous 2021-10-16 13:19
He wants to iterate through the substring and match after the first letter match. But he put the semicolon before the brackets.
21 Name: Anonymous 2021-10-16 14:09
I’ve found that 1) People larp as more skilled than they are, so when you need help they vanish. 2) People are often lost when you ask for help with a language they aren’t used to working with 3) I couldn’t even pay a faggot to do some programming as a side job. People either have no idea, or they’ve got no interest teaching, or they’re not motivated by money.

You’re basically ok your own and have to figure it out
22 Name: Anonymous 2021-10-16 15:16
Also, people will ask for the data and then disappear because they can’t do it anyway
23 Name: Anonymous 2021-10-16 16:40
I fixed the for loops semicolon thing. Output is still fucked.
24 Name: Anonymous 2021-10-16 17:47
Your logic is a bit messed up.
You’ll exit the first time there isn’t a match.

Once you hit the first “l” you’ll check if the substr exist, it’ll return 0, and not check the next “l”.

You have to only return 0 after i == strlrn(str)
25 Name: Anonymous 2021-10-16 20:00
Fuck this, and fuck your hard to read code. I am not counting "{"s for you, anon.

Begin from scratch, and we'll make an epic fucking program together. A retarder /prog/ dwarf fortress or whatever. Anyone game?
26 Name: Anonymous 2021-10-16 20:36
Holy shit you're right. Thank you so fucking much. I'm such a retard
27 Name: Anonymous 2021-10-16 20:53
you should get ur braces under control though :)

it'll make things easier on your in the log run
28 Name: Anonymous 2021-12-04 05:39

Dude, ignore those illiterate faggots. i, j go brrr. I suggest you reading Kernighans The C Prog Lang.

Leave this field blank: