my code stops running at
populate_div_sales(div_sales, div_regions, 4); and gives me errors saying
en242@cs04:~> c++ top_div_array.cpp -o top_div_array
/tmp/ccIPcn3r.o(.text+0xc2): In function `main':
: undefined reference to `populate_div_sales(float*, std::basic_string<char, std::char_traits<char>, std::allocator<char> >*, int)'
collect2: ld returned 1 exit status
in a shell the whole code works as im doing piece by piece cause my pico complier is giving lot of errors. , so now im doing little by little so it runs and i know where its giving errors.
Adding to what coder777 said what that confusing compiler message says if that you forward declared the function name at line 7 in the prototype, but have yet to actually write the function.
The error message is kind of cryptic and hard to understand right now. Once you have made this mistake a few time and learn how to read your error messages it gets easier. Some times you may find that this type of error message happens when you misspell something where. Either the prototype, function call or function definition.
Sometimes you will find an error message that refers to a line number, but the actual error in in the line above or it may be two or three lines above. Just something to keep in mind.