Casa > H > How To Solve Errors In Coding

How to solve errors in coding

Debugging is the only key to find out and solve the errors in coding.

Errors can be anything. It can be:-

  1. Syntax errors
  2. Logical errors
  3. semantic errors

Syntax errors is the most common error that we usually do but it is very easy to find out(except few language) and debug.

We usually used to forget “;” at the end of program statement.

  1. int a = 0 // ; is missing 

Logical errors is the most difficult to find out error but we usually think that i himself has developed the logic and coded for it. so there is no chance for logical error and we usually ignore it.

  1. int CalculateRectangleArea( int length, int breadth) 
  2. return length + breadth;  
  3. /* instead of "*" we use "+". */  

semântica ocorre normalmente devido a um uso impróprio das instruções do programa.

EX: temos de comparar duas variáveis mas em vez de usar "==" (operador relacional) usamos "="(operador de atribuição) por engano.

  1. if( a = b ){ } /* aqui em vez de fazer comparação de igualdade o código está de facto a fazer trabalho. */ 

So before solving errors in coding first see the errors carefully and find out whether it occurring due to syntax , logical and semantic errors.

put debug point wherever in code you feel that may be due to this line error is coming.

Enjoy

De Reiser

Como resolver o problema de 'erro de conexão ou código mmi inválido' :: Como posso corrigir o código de erro HP 0x83c0000a?