Logic Error Article Index for
Logic
Website Links For
Logic
 

Information About

Logic Error





EXAMPLE OF A LOGIC ERROR IN C



  • Print all the days of the week---/

  • {

  • days {Link without Title} = {"Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"};

  • int i;

for(i=0;i<7;i++)
printf("Day %d: %d
",i,days {Link without Title} );
}

In the above example, ''days {Link without Title} '''s memory location in integer form is printed and not the string it contains, producing unexpected results but not failing the program.


SEE ALSO