aloha community,
got a little problem with my c-code ...
i need to write a program for polynom calculation.
looks like this:
when i try to compile i gett the following errors:Code:#include <stdio.h> #include <math.h> main() {int grad=0; float ergebnis=0; float ableitung=0; int x=0; printf ("\n Dieses Programm berechnet den Funktionswert sowie die erste Ableitung eines beliebigen Polynoms aus\n"); printf ("\n Geben sie den Grad des Polynoms ein!\n"); scanf ("%d" &grad); int *vielfache = new int grad; for (int i=0; i-1 <grad; i++) {vielfache[i]=0}; while (int k=0; int i=0 ; k-2 < grad; k++; i++) {printf ("\n Geben sie das \n &k \n . Vielfache des Polynoms ein!\n"); scanf ("%d" &vielfache[i]);} printf ("\n Geben sie einen Wert für x ein!\n"); scanf ("%d" &x); int *zwischenwert = new int grad; for (int l=0; l-1 < 2*grad; l++) {zwischenwert[l]=0;} while (int i=0; int l=0; i-1<grad;) {vielfache[i]*x=zwischenwert[l]; i++; zwischenwert[l]+vielfache[i]=zwischenwert[l+1]; zwischenwert[l+1]=ergebnis; l++; l++; i++;} prinft ("\n Der Funktionswert des Polynoms ist\n &ergebnis \n!") return0; }
i can´t figure out, what´s wrong...Code:program.c: In function ‘main’: program.c:12: error: invalid operands to binary & (have ‘char *’ and ‘float’) program.c:13: error: ‘new’ undeclared (first use in this function) program.c:13: error: (Each undeclared identifier is reported only once program.c:13: error: for each function it appears in.) program.c:13: error: expected ‘,’ or ‘;’ before ‘int’ program.c:14: error: ‘for’ loop initial declarations are only allowed in C99 mode program.c:14: note: use option -std=c99 or -std=gnu99 to compile your code program.c:15: error: expected ‘;’ before ‘}’ token program.c:17: error: expected expression before ‘int’ program.c:19: error: invalid operands to binary & (have ‘char *’ and ‘int’) program.c:22: error: invalid operands to binary & (have ‘char *’ and ‘int’) program.c:24: error: expected ‘,’ or ‘;’ before ‘int’ program.c:25: error: ‘for’ loop initial declarations are only allowed in C99 mode program.c:28: error: expected expression before ‘int’ program.c:29: error: lvalue required as left operand of assignment program.c:31: error: lvalue required as left operand of assignment program.c:39: error: expected ‘;’ before ‘return0’
someone able to help me?
please excuse my bad english.
greetz!
dreadkopp



LinkBack URL
About LinkBacks



