Get Even More Visitors To Your Blog, Upgrade To A Business Listing >>

CS50 Problem Set 2 – Caesar — How to check argv[1] for digits

 // Make sure every character in argv[1] is a digit

After two days of nearly losing it, here’s how I cracked it, thanks to Cliff B, user:4847, on StackExchange.

SOURCE: https://cs50.stackexchange.com/questions/42421/stuck-on-pset-2-caesar-checking-the-key-step

Logical Issue


isdigit

!isdigit

isdigit doesn’t loop through all char(s). As soon as it finds the 1st digit, returns TRUE and stops.

The post CS50 Problem Set 2 – Caesar — How to check argv[1] for digits appeared first on TIPSOGRAPHIC.



This post first appeared on Tipsographic, please read the originial post: here

Share the post

CS50 Problem Set 2 – Caesar — How to check argv[1] for digits

×

Subscribe to Tipsographic

Get updates delivered right to your inbox!

Thank you for your subscription

×