Programming Thread

Started by the-pi-guy, Mar 13, 2016, 10:39 PM

previous topic - next topic

0 Members and 2 Guests are viewing this topic.

Go Down

the-pi-guy

So, people.  

What was a bad programming mistake you made?  

the-pi-guy

Oct 08, 2017, 09:33 PM Last Edit: Oct 08, 2017, 09:38 PM by the-pi-guy
I'm having some issues with C.  
I'm trying to compare two strings...  And the stack overflow solution isn't working at all.  

For some reason trying to print out:
Char s[100];
print(s[0]);

This code prints the entire array.

Legend

So, people.  

What was a bad programming mistake you made?  
I make infinite loops far too commonly.

I'm having some issues with C.  
I'm trying to compare two strings...  And the stack overflow solution isn't working at all.  

For some reason trying to print out:
Char s[100];
print(s[0]);

This code prints the entire array.
Does s[1] also print the whole array?

the-pi-guy

I make infinite loops far too commonly.
Does s[1] also print the whole array?
I figured out part of it.  
I was misusing pointer stuff.
s[1] prints out the whole array minus the first character.  

the-pi-guy

For some reason one print line executes and the one underneath it doesn't. 
C is upsetting... 

Go Up