Liste des Groupes | Revenir à cl c |
On 2025-04-04, Thiago Adams <thiago.adams@gmail.com> wrote:What do you think of this control block?>
>
do
{
FILE f = fopen("file.txt", "r");
>
if (f == NULL) quit; /*goes to else part*/
>
/*success here*/
for (int i =0; i < 10; i++){
...
if (error) quit;
}
>
}
else
{
/*some error*/
}
>
The else part might need access to some local variables
in the main part.
>
do {
char *name = calculate_path(PATH_PREFIX "/", name, ".txt");
FILE *f = fopen(...)
>
if (!f)
quit;
...
}
else
{
printf("unable to open %s\n", name);
...
}
>
If you make that work, you're creating scope wormholes between
disjoint curly braces, which is not allowed if youre name isn't
Bjarne Stroustrup.
Les messages affichés proviennent d'usenet.