9.h
9.h
Explore posts from servers
CC#
Created by 9.h on 1/30/2024 in #help
for loop casuing error
Ty
24 replies
CC#
Created by 9.h on 1/30/2024 in #help
for loop casuing error
Oh yeah that too
24 replies
CC#
Created by 9.h on 1/30/2024 in #help
for loop casuing error
for (int i = 0; i < length-1; i++)
{
if (sentence2[i] == sentence2[i++])
{
notrepeating = false;
}
}
for (int i = 0; i < length-1; i++)
{
if (sentence2[i] == sentence2[i++])
{
notrepeating = false;
}
}
24 replies
CC#
Created by 9.h on 1/30/2024 in #help
for loop casuing error
So,
for (int i = 0; i < length-1; i++)
for (int i = 0; i < length-1; i++)
and the rest the same as at the start
24 replies
CC#
Created by 9.h on 1/30/2024 in #help
for loop casuing error
In that case, is the solution to - 1 from length in the for loop?
24 replies
CC#
Created by 9.h on 1/30/2024 in #help
for loop casuing error
So doesn't my change fix that as it prohibits i from reaching the maximum value?
24 replies
CC#
Created by 9.h on 1/30/2024 in #help
for loop casuing error
for (int i = 0; i < length; i++)
{
if (sentence2[i] == sentence2[i+1] && i != length)
{
notrepeating = false;
}
}
for (int i = 0; i < length; i++)
{
if (sentence2[i] == sentence2[i+1] && i != length)
{
notrepeating = false;
}
}
24 replies
CC#
Created by 9.h on 1/30/2024 in #help
for loop casuing error
So it will stop once i = length which would be fine as position length was already checked with length - 1
24 replies
CC#
Created by 9.h on 1/30/2024 in #help
for loop casuing error
What if I add another condition to the if, stating that i must not be equal to the length?
24 replies
CC#
Created by 9.h on 1/30/2024 in #help
for loop casuing error
I am not sure how to fix that yet but I'll figure it out
24 replies
CC#
Created by 9.h on 1/30/2024 in #help
for loop casuing error
Thank you, I will check this when I get home
24 replies
CC#
Created by 9.h on 1/30/2024 in #help
for loop casuing error
Hmmm
24 replies
CC#
Created by 9.h on 1/30/2024 in #help
for loop casuing error
There is no value 1 above the last
24 replies
CC#
Created by 9.h on 1/30/2024 in #help
for loop casuing error
I think the root of my issue is the ++, I should put a + 1 instead, I'll check when I get home
24 replies
CC#
Created by 9.h on 1/30/2024 in #help
for loop casuing error
The for loop is meant to check if there are any repeating characters. My logic is that, once I sort the array, if there are any repeating characters, they will be next to each other, and so the IF should turn the NOTREPEATING boolean into false
24 replies
CC#
Created by 9.h on 1/30/2024 in #help
for loop casuing error
GFEDCBA is a good testing string as it should theoretically satisfy all the requirements
24 replies
CC#
Created by 9.h on 1/30/2024 in #help
for loop casuing error
The for loop in question is the last one, the sentence2[i] == sentence2[i++] one. When I remove it, the program works completely fine. With it, it suddenly does not print the last writeline saying it is correct even if it is
24 replies
CC#
Created by 9.h on 4/23/2023 in #help
❔ Indexing with [] to an expression type IEnumerable / array
Basically is parsing changing a string into a value
128 replies
CC#
Created by 9.h on 4/23/2023 in #help
❔ Indexing with [] to an expression type IEnumerable / array
I am a bit confused as to what parsing is, and google's answer is not the most helpful
128 replies
CC#
Created by 9.h on 4/23/2023 in #help
❔ Indexing with [] to an expression type IEnumerable / array
If I want to include numbers in an array/list, what else should I do other than Convert.ToInt32? In my college the teacher taught me to do that whenever trying to get an int from the user
128 replies