0

Okay, this is a part of my caesar code, and I don't think I am getting what the graders are trying to tell me. The output I gave them was not what they said that I am giving them

Code

#include <stdio.h>
#include <cs50.h>
#include <stdlib.h>
#include <string.h>
#include <ctype.h>

int main(int argc, string argv[])
{

int Input = atoi(argv[1]);
int NewNumber;

if (argc != 2)
{
    printf ("ERROOOOROORORORORORORORORORORORRR!!!!!!\n");
    return 1;
}

Check50 Response

> :( handles lack of argv[1]    \ expected output, not standard error of
> "/opt/sandbox50/bin/run.sh: line 31: 221..."

1 Answer 1

2

you need to follow the pset specs literally as it's machine-graded. if argv[1]<>1, you need to return 1 right away instead of giving an error message

8
  • I removed the printf, and still recieved the same message on check50. What does expected output mean?
    – BooFluff
    Commented May 23, 2015 at 0:12
  • i think the snippet of error above got cut, what standard error message are you getting, that should give you a hint as to what's going wrong. also, are you getting smiley faces? if not, check 50 is expecting a particular coded message which your code is not outputting
    – ronga
    Commented May 23, 2015 at 9:20
  • I am getting all smileys except that one
    – BooFluff
    Commented May 25, 2015 at 6:52
  • and the error message is just that, nothing more specific? how about moving the error handling earlier, i.e. put if argc<>2 line above int Input line?
    – ronga
    Commented May 25, 2015 at 12:43
  • it works! thx. I just needed to move everything up
    – BooFluff
    Commented May 25, 2015 at 19:22

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .