Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Non-portable code #1

Open
Sainan opened this issue May 28, 2023 · 1 comment
Open

Non-portable code #1

Sainan opened this issue May 28, 2023 · 1 comment

Comments

@Sainan
Copy link

Sainan commented May 28, 2023

The following line of code is not valid ISO C++:

int verif[size1 + 1][size2 + 1]; // Verification matrix i.e. 2D array which will store the calculated distance.

As such, it does not compile with all compilers. For example, MSVC can not compile this.

@rsnitsch
Copy link

Correct. You can replace that line with:

vector<vector<int>> verif(size1 + 1, vector<int>(size2 + 1));

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants