0

Hi, from the result in my "for" loop, have stored four value.
How to extract that value to show the value(sprintf) ?

Kindly refer to the attached the image file.

Thanks

Regrads,
nazif

Attachments sad.PNG 16.23 KB
2
Contributors
2
Replies
17
Views
2 Years
Discussion Span
Last Post by naz1234
1

First of all the code for (a=4; a<5; a=a++) is undefined behaviour, you probably meant for (a=4; a<5; a++) which 'loops' a from 4 to 5 (essentially just running the loop once on the value a=4.

To use a value found inside the loop outside of it, it must be declared outside of it. Therefore your intended code was likely:

while (1) {
    <type> result;
    for (...) {
        ...
        result = ...;
    }
    //use result here all you want
}
0

Thank you Labdabeta

Edited by naz1234: grammar

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.