#C Simple Parsing Calculator long double array not storing data correct.

11 messages · Page 1 of 1 (latest)

vestal creek
#

Title

split roostBOT
#

When your question is answered use !solved to mark the question as resolved.

Remember to ask specific questions, provide necessary details, and reduce your question to its simplest form. For tips on how to ask a good question use !howto ask.

vestal creek
#

The problem is with first_digit resulting in the result var be -nan

pliant lark
split roostBOT
pliant lark
#

this doesn't do anything and is wrongc while (1) { char** contents; printf("> "); scanf("s", &contents); parser(contents); }

#

scanf expects a char buffer to store the string

#
while (1) {
    char contents[256]; // assume this is large enough
    printf("> ");
    scanf("%s", contents);
    parser(contents);
}```
#

try this

#

and see if whatever issues you have are gone