Thanks.
Type: Posts; User: firehydrant
Thanks.
The error is on the exp[j]... line. I don't think I need an & there.
There seems to be an error when I try to compile this code. This is a sample code from my homework (parsing a polynomial).
main()
{
char string[max];
int exp[max];
int i = 0,...
I got it already. Thanks! I didn't change the array argument in the strcpy function. Why did it work? Doesn't the initialization --tokens[STRINGS][MAXLENGTH]-- mean that it's a 2D array?
in the strcpy function, how would the array argument look like?
Will I change it to something like this? since it's already a 2D array
strcpy(tokens[i++][k++], token)
I'm using the strtok & strcpy for the program I'm doing. It's sort of a parser of polynomial equations. The strtok function works fine. However, when I try to add the strcpy function to save the...
Thanks! I'll try the isupper and islower later.
this is already a bit off topic, but it's still part of the program i'm working on. I saw this sample code about parsing.
/* strtok example */
#include <stdio.h>
#include <string.h>
int...
@quzah
isNum and isAlpha are functions I wrote in the program.
I'm new in this forum so sorry for that.
I tried the isdigit and isalpha with the stdlib header file but the compiler says it's undeclared.
oh thanks! I tried it and it worked. A little problem with the condition for numbers though.
When using this sample code, the numbers in the string passes the 2nd if, and also the else.
...
I'm trying to parse a string (polynomial function) for my program. Are these conditions allowed for if and while?
if (a >= '0' && a <= '9') ---> checks if char is a number
if ( a>= 'A' && a...
I already did a version just like what you said for my program, as a last resort. But it's required that the user will input the whole polynomial. Right now, I'm trying to do a polynomial parser, and...
how do you that math expression parsing?
ok
Thanks!
how do i do it exactly?
we haven't tackled structs yet in class, so as of the moment, i can't use those.
if i use strings to store the polynomial, is there a way to pick out the numeric parts of it? that way, i can...
how?
say i use strings to store the polynomial, how can i save it as a function?
our homework is actually a long one, about numerical analysis, roots of poylnomials, etc. the problem is i don't know how to do the first step, which is storing/saving a user-input polynomial(eg this...