Questions tagged [isdigit]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
1 vote
1 answer
49 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 ...
user avatar
  • 13
0 votes
1 answer
33 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 ...
user avatar
0 votes
2 answers
110 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 ...
user avatar
0 votes
1 answer
50 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 ...
user avatar
0 votes
1 answer
36 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 ...
user avatar
0 votes
1 answer
109 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 ...
user avatar
0 votes
1 answer
75 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 ...
user avatar
0 votes
1 answer
40 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 &...
user avatar
0 votes
1 answer
75 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 ...
user avatar
  • 7
0 votes
1 answer
351 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 ...
user avatar
0 votes
2 answers
298 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 |...
user avatar
0 votes
0 answers
43 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>...
user avatar
  • 11
1 vote
1 answer
228 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 ...
user avatar
0 votes
1 answer
247 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 ...
user avatar
  • 7