Code not working | Sololearn: Learn to code for FREE!

0

Code not working

My code was working and now giving error.... What's problem? https://code.sololearn.com/cnhg3RnTVXjw/?ref=app

c++

3/25/2020 2:35:04 PM

C ++

17 Answers

New Answer

+5

#pragma once does not work here so comment it out. Other than that your program has warnings for unused variables.

+3

Nope they are not used anywhere, you have just declared/initialized them else the compiler will not give you a warning.

+3

you are declaring and initialising variable whitespace = 0; then later on you are doing whilespace = 0; return false. Compiler is probably seeing this as useless declaration and it in a way since whitespace is a local variable so no point in setting it and then return from function. so remove it warning will go.

+2

Unused variables warning? Note down the unused variables(see the compiler warning) and remove them.

+2

int whitespace; is a definition with whitespace initialized randomly int whitespace = 1; is a definition with whitespace initialized to 1 standalone whitespace = 1; is an assignment remove whitespace from the definition and later assignment.

+2

In Visual Studio it is working fine... I don't get that, why it is not working here... Now I have removed the variable... I created this for some purpose but now I don't remember what was that... Thanks for help

+2

Different compiler can give different warning due to their internal optimizations. Going by Standards it should have worked fine.

+1

Prog is working

0

How to stop this?

0

They are used in Program.

0

if(isspace(input[counter])) { whitespace = 0; return false; } if( ispunct(input[counter]) ) { symbbol = 1; counter++; continue; } if( isdigit(input[counter]) ) { digit = 1; counter++; continue; } if (isalpha(input[counter])) { alpha = 1; counter++; continue; } counter++; } if ((symbbol == 0) || (digit == 0) || (alpha == 0)) { return false; } else { return true; } } Here theery used

0

Whitespace = 1; It is the declaration

0

After removing them... Still giving error....

0

It works idk what's a password

0

Please am new here can u teach me

0

It check if entered password is strong or not

0

nilay doshi now working.