All Questions
5 questions
0
votes
1
answer
26
views
CS50 Pset 2 Substitution - Array size errors
I'm using a for loop to assign chars to each element of an array one at a time. The array has been assigned a size and the for loop runs the same number of iterations as the array size, but I find ...
0
votes
1
answer
4k
views
How to find if element is not in an array
Does anyone know of an easy way in C to check if a an element is NOT in a given array?
I think it would be fairly easy to determine if an element IS in an array by looping through it and seeing if an ...
0
votes
1
answer
135
views
Why string variable has no square bracket?
Though it's said that string is an array of characters why string variable does not have square brackets on the immediate right?
In CS50 we call string as
string s
why not as string[]?
then how can ...
1
vote
1
answer
132
views
Pset2: Copying string contents
I just can't seem to get this right.
The example in the week 2 short Arrays is as follows:
int foo[5]{1,2,3,4,5};
int bar[5]
for(j=0;j<5;j++)
{
bar[j]=foo[j];
}
This does not seem to work with ...
0
votes
1
answer
66
views
handlign multidimesional arrays as function arguments and return values
So I stuck at the pset3, at the place where you need to implement game of fifteen. How can I pass multidimensional array as an function argument? And how can I return multdimesional array as a ...