Search Results
Search type | Search syntax |
---|---|
Tags | [tag] |
Exact | "words here" |
Author |
user:1234 user:me (yours) |
Score |
score:3 (3+) score:0 (none) |
Answers |
answers:3 (3+) answers:0 (none) isaccepted:yes hasaccepted:no inquestion:1234 |
Views | views:250 |
Code | code:"if (foo != bar)" |
Sections |
title:apples body:"apples oranges" |
URL | url:"*.example.com" |
Saves | in:saves |
Status |
closed:yes duplicate:no migrated:no wiki:no |
Types |
is:question is:answer |
Exclude |
-[tag] -apples |
For more details on advanced search visit our help page |
0
votes
1
answer
97
views
i don't know what's wrong with my code. Trying to convert from string to long
INPUT
int main(void)
{
long long cardnumber, calc;
string credit[0];
string nonnumeric;
//long long calc = card number;
int countcardcharacters = 0;
long long c;
//user input
do
{
credit[0]= get_string …
0
votes
When I multiply my array by 2 it doesn't give expected value
this converts it from its ASCII form
(checksumarray[0][x] - '0')
0
votes
1
answer
30
views
When I multiply my array by 2 it doesn't give expected value
#include <cs50.h>
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
bool checksum(string checksumarray[0]);
int main()
{
long long cardnumber = 0, calc;
//string credit[1];
//string lengthkey[ … 1];
string credit;
string lengthkey[1];
//user input
do
{
credit = get_string("Card number: ");
}
while ((credit <= 0));
//to check if condition works
printf("%s credit\n", credit);
//the long long …