p' does not name a type Fingerprint module

I use the below code for a fingerprint gsm otp based verification system using arduino,but when i compile it it shows the error “‘p’ does not name a type”.Can you please tell what is it??How to solve it?
the entire code is given below

fullactualcode.ino (15.5 KB)

  p = finger.image2Tz();

This one?

It looks to me like it isn't in a function, but it should/must be.

Check your { match your }

  {
  int getFingerprintIDez();
  delay(50);            //don't ned to run this at full speed.
  }

Strange place for a function prototype.

Can you please post the complete error message

That code is full of mistakes, mostly '{' or '}' missing or where they should not be.

Common compiler errors caused by mismatched brackets:

"does not name a type" or "expected declaration before" or "expected unqualified-id before" or "expected initializer before" Usually means you forgot a '{' or put in an extra '}' in the previous function. Since all of the open brackets have been closed, the compiler is looking for further global declarations (variables or functions). If it finds something that looks like executable code instead of a global declaration it emits an error. Make sure that the brackets in the preceding function are in matching pairs '{' followed by '}'.

"a function-definition is not allowed here before '{' token" (can cause: "'functionName' was not declared in this scope") Usually means you forgot a '}' or put in an extra '{' in the previous function. Since a set of brackets has not been closed yet the compiler is looking for more code to put in the function. You can't declare a function inside a function so if the compiler finds a function declaration it emits an error. Make sure that the brackets in the preceding function are in matching pairs '{' followed by '}'.

"expected '}' at end of input" Usually means you forgot a '}' or put in an extra '{' in the last function in the sketch. Since a set of brackets has not been closed yet, the compiler is looking for more code to put in the function. When it hits the end of the file instead, it emits an error. Make sure that the brackets in the last function are in matching pairs '{' followed by '}'.

"expected primary-expression before '}' token" Usually means you have an incomplete statement before a '}'. The block statement (between '{' and matching '}') can only contain complete statements. Complete statements always end with ';' (or '}' for a block statement).