c++ - Code Keeps saying: "[Error] cannot convert 'float*' to 'float' for argument '1' to 'void test(float, int)'" -


#include <iostream>  using namespace std; void test(float, int);  int main() {      const int size=11;     float a[size];      test(a, size);      return 0; }  void test(float a[], int size) {     [....] } 

it points test(a, size); can't figure out whats wrong(i'm learning coding , learned arrays/confused)

your function prototype void test(float, int); not match function void test(float a[], int size). change prototype @ top void test(float a[], int size); (i leave input variable names in prototype consistency, not necessary).


Comments

Popular posts from this blog

Django REST Framework perform_create: You cannot call `.save()` after accessing `serializer.data` -

Why does Go error when trying to marshal this JSON? -