Hot answers tagged

3 votes
Accepted

week3 lecture very beginning

If I understand your question correctly, and it's "what is the role of argc" the answer is that we need it to know how many arguments were passed to main from the command line. So if the command was ./...
user avatar
  • 7,326
2 votes
Accepted

vigenere ,, segmentation fault core dumped

Your problem is isalpha(argv[1]) isalpha takes a single character as input. argv[1] is a string of multiple characters, not a character. You cannot apply isalpha to an entire string. It causes a seg ...
user avatar
  • 63.1k
1 vote
Accepted

PSET 3 runoff is_tie function

According to the spec: The function should return true if every candidate remaining in the election has the same number of votes, and should return false otherwise. I interpret the name of the ...
user avatar
1 vote

Find.c - Binary Search probable integer overflow

Your values are like +---+---+---+---+ |min|max|mid|<>=| +---+---+---+---+ | 0|999|499| < | | 0|498|249| < | | 0|248|124| < | | 0|123| 61| < | | 0| 60| 30| < | | 0| 29| 14| ...
user avatar
  • 20.7k
1 vote
Accepted

Week 3 Binary Search Video Short question

in case we have a single element left in the array, max and min would be equal. the midpoint is calculated, and we check whether array[midpoint] is equal to the value we're looking for. if the ...
user avatar
  • 17.3k
1 vote
Accepted

Initials ,, The Right output but not accepted

You also need to print a new line \n after the final letter. So after your for loop has ended just print a new line.
user avatar
  • 7,326

Only top scored, non community-wiki answers of a minimum length are eligible