| |

VerySource

 Forgot password?
 Register
Search
View: 1969|Reply: 14

Is it safe

[Copy link]

1

Threads

2

Posts

3.00

Credits

Newbie

Rank: 1

Credits
3.00

 China

Post time: 2020-1-10 16:40:01
| Show all posts |Read mode
for (i = MinIndex + 1; i <= MaxIndex; i ++)
{
if (conditions met)
{
return false;
}
} return true;
 For this function, it may return before the loop ends. Is this safe
Reply

Use magic Report

1

Threads

3

Posts

45.00

Credits

Newbie

Rank: 1

Credits
45.00

 China

Post time: 2020-1-10 17:40:36
| Show all posts
This way, there is no problem in terms of grammar rules!
Reply

Use magic Report

0

Threads

23

Posts

13.00

Credits

Newbie

Rank: 1

Credits
13.00

 China

Post time: 2020-1-13 10:45:02
| Show all posts
What language did you learn before?
Reply

Use magic Report

0

Threads

18

Posts

12.00

Credits

Newbie

Rank: 1

Credits
12.00

 China

Post time: 2020-1-13 13:27:01
| Show all posts
It doesn't matter, find the appropriate value and return, there is no need to continue!
Reply

Use magic Report

1

Threads

2

Posts

3.00

Credits

Newbie

Rank: 1

Credits
3.00

 China

 Author| Post time: 2020-1-14 12:27:01
| Show all posts
C language
Reply

Use magic Report

0

Threads

6

Posts

5.00

Credits

Newbie

Rank: 1

Credits
5.00

 China

Post time: 2020-1-15 19:27:01
| Show all posts
while (1)
{
if (conditions met)
{
return false;
}
}
return true;
// Too many variables
Reply

Use magic Report

0

Threads

3

Posts

3.00

Credits

Newbie

Rank: 1

Credits
3.00

 China

Post time: 2020-1-20 01:00:01
| Show all posts
No problem, only one point. If you used malloc to apply for memory before, you must use free to release it.
Reply

Use magic Report

0

Threads

3

Posts

3.00

Credits

Newbie

Rank: 1

Credits
3.00

 China

Post time: 2020-1-20 23:36:01
| Show all posts
There must be no problem!
Reply

Use magic Report

0

Threads

5

Posts

3.00

Credits

Newbie

Rank: 1

Credits
3.00

 China

Post time: 2020-1-21 13:09:01
| Show all posts
It should be available, what is it for and what is it for?
Reply

Use magic Report

1

Threads

9

Posts

8.00

Credits

Newbie

Rank: 1

Credits
8.00

 China

Post time: 2020-1-21 19:36:01
| Show all posts
for (i = Min + 1; i <= Max; i ++)
{
    if (conditions met)
    {
        return false;
    }
}
return true;
Still look cool like this ...
Reply

Use magic Report

You have to log in before you can reply Login | Register

Points Rules

Contact us|Archive|Mobile|CopyRight © 2008-2023|verysource.com ( 京ICP备17048824号-1 )

Quick Reply To Top Return to the list