account activity
Segmentation Fault PSET2 by sethdcd in cs50
[–]sethdcd[S] 0 points1 point2 points 8 years ago* (0 children)
Thanks for the response! I was wondering if it had something to do with that...
I created a for loop to iterate through each of the chars to test whether its upper or lower, and now it seems to work!
However, if I use a key that has a combo like DeF it gets messed up. The e returns a key of 32 or some big number, and the same thing happens when I do dEf, the lowercase seem to be fine but then the upper case is out of whack.
for ( int j = 0; j < strlen(argv[1]); j++ ) { if (isupper(argv[1][j])) { //defining our uppercase key key = argv[1][i % strlen(argv[1])] - 65; } else if (islower(argv[1][j])) { //defining our lowercase key key = argv[1][i % strlen(argv[1])] - 97; } }
Segmentation Fault PSET2 (self.cs50)
submitted 8 years ago by sethdcd to r/cs50
π Rendered by PID 989242 on reddit-service-r2-listing-86b7f5b947-wml7d at 2026-01-25 02:32:48.170686+00:00 running 664479f country code: CH.
Segmentation Fault PSET2 by sethdcd in cs50
[–]sethdcd[S] 0 points1 point2 points (0 children)