C programing: scanf dont read :(
#1

new POST EDIT=============SOLVED
new error with c, this time imade test why i get allways answer 0.. and i made test program which shows that all arguments after scanf =0
the code..
Код:
float a,b,c,x1,x2,D;  
  scanf("%f%f%f",&a,&b,&c); 
  printf("readed:\na= %f\nb= %f\nc= %f\n",&a,&b,&c); // that is eror must be printf("readed:\na= %f\nb= %f\nc= %f\n",a,b,c); fool me :-[
it prints me:
Код:
readed:
a=0.000000
b=0.000000
c=0.000000
also bump now cause old post was yesterday
help if you can



=================================
============OLD post solved==========
Please need help with C has anybody any idea how to make menu system look and you will understand, my script structure:
this one has error that i mentioned because it is abowe void menu
Код:
void calculator
this is menu vuid from where i call other voids and i want menu has links to every void and every other void should had a back link
Код:
void menu
this is main and here is loaded menu void and some messages
Код:
int main
hope understood, so i cant make links circle with voids, should i use some other call or add third void?
//===============edit no problem fixed destroyed circles
but now another proble i got crash even i try to sqare rise count or sqrt it
Код:
 float n1, n0;
  scanf("%s %f",m0,n1);
  if(strcmp(m0,"end")==0)exit(EXIT_SUCCESS); //iseiti
  else if(strcmp(m0,"square")==0)n0=n1*n1;  //sqare
  else if(strcmp(m0,"cube")==0)n0=n1*n1*n1;  //cube
  else if(strcmp(m0,"sqrt")==0)n0= sqrt(n1); //sqrt
  else                     //if none
  {
    printf("Bad symbol of format");
//that doesnt matter
....
}
//=======edit
fool me!

Quote:

scanf("%s %f",m0,n1);

should bee
Код:
scanf("%s %f",&m0,&n1);
Reply


Messages In This Thread
C programing: scanf dont read :( - by oggylt - 08.04.2010, 16:22
Re: C programing: scanf dont read :( - by m0niSx - 09.04.2010, 20:58
Re: C programing: scanf dont read :( - by oggylt - 09.04.2010, 23:07
Re: C programing: scanf dont read :( - by m0niSx - 10.04.2010, 14:25

Forum Jump:


Users browsing this thread: 1 Guest(s)