We changed our privacy policy. Read more.

Questions tagged [isdigit]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0
votes
1answer
18 views

Unable to confirm user input is a number using isdigit in c

My code is attempting to; take user input from the command line; check if the input is a whole number; confirm positively if so; confirm negatively if not; however all numbers return a negative ...
0
votes
1answer
28 views

For loop proccing too many times

In the code below I check whether or not the string is or isn't a digit. To do that I iterate through every single value entered in the argv[1]. Unfortunately when the entered key is larger than one ...
0
votes
2answers
51 views

Caesar segmentation fault

I prematurely submitted my code without including the if() statements that check if the second command line argument was a digit (if not it would produce an error message). My code was running ...
0
votes
1answer
40 views

Help with Either Command Line Argument or Arrays for Problem set 2 Caesar

I am on Problem Set 2: Caesar. Right now I'm trying to write code that first checks if the second command line argument is a int and if it does prints the integer. I got my program to compile after ...
0
votes
1answer
25 views

Segmentation fault: Pset 2 Caeser isdigit

The log is telling me: "Segmentation fault", and after looking into it, I figured out the problem was in the "isdigit", but i don't know how to fix it, i'm here for about 2 hours ...
0
votes
1answer
38 views

PSET2 Caesar - Stuck at 'isdigit' step: Do I need to learn about pointers, or is something else going on?

Here is what I am attempting, and my errors. I am gathering that I am not grasping the "array of strings nature of argv[], and since I am following along with the material from class, I am pretty ...
0
votes
1answer
36 views

Segmentation error Caesar using isdigit

Getting this segmentation error for inproper use of isdigit in my If statement, i just don't know how else to check argv[1] for numerical value as opposed to alphabetical. int main(int argc, string ...
0
votes
1answer
19 views

pset2 (ceasar) - isdigit function not working correctly returns "expected expression" error

I don't know why I am getting an error on my isdigit() function, it seems correct to me. #include <stdio.h> #include <cs50.h> #include <stdlib.h> #include <string.h> #include &...
0
votes
1answer
66 views

Caesar: Validating the key - stuck

I am stuck with Caesar, validating the key. Before i use the atoi function, I want to check if argv consists of digits. I watched the linear search movie but is is to cryptic for me. I have to ...
0
votes
1answer
205 views

Checking a string to see if it's an integer

I'm currently working on Caesar and I'm trying to go through each step in turn to complete it. As the problem set requires, I've written code that runs from the command line. The code below ...
0
votes
2answers
294 views

pset2 how to use ctype.h functions

it takes me really long time to figure this out and am not making any progress so i was wondering if someone could help. how do i use, for example, isalpha in if statement. like: if ( argc != 2 |...
0
votes
0answers
41 views

error message with loop with isdigit function

I have trouble with isdigit() function, I get error for line 27-else loop: #include <cs50.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #include <ctype.h>...
1
vote
1answer
222 views

pset2 caesar, argv[1]

Ok I'm consistently encountering a peculiar issue that I can't get my head around. this loop should return an error if there is a character other than a digit. When I give a character other than a ...
0
votes
1answer
237 views

Problem with isdigit function

I have this code here but the program is all the time saying that the input isn't a number, even if I enter a digit between 1 and 10. Could you help me to find why? Thanks int main (void){ int ...