I have written this code outside all functions:
int l, k;
for (l = 1; l <= node; l++)
{
for (k = 1; k <= node; k++)
{
flow[i][j] = capacity[i][j];
flow[j][i] = 0;
}
}
It is giving me the following error on compilation:
shalini@shalini-desktop:~$ g++ -o output fords.cpp
fords.cpp:63: error: expected unqualified-id before ‘for’
fords.cpp:63: error: expected constructor, destructor, or type conversion before ‘<=’ token
fords.cpp:63: error: expected constructor, destructor, or type conversion before ‘++’ tok
You can’t write code outside of functions. The only things you can have outside of functions are declarations such as global variable declarations (usually a bad idea), function declarations etc. Try putting it in a function like
int main(){}