c++ - Why does MPI_Send accept void * source? -
i wondering why signature of mpi_send below: int mpi_send(void *buf, int count, mpi_datatype datatype, int dest, int tag, mpi_comm comm) the first parameter of type void * . why first parameter of type void * rather const void * . mpi_send modify source? i ask such kind of question because use mpi c++ , pass message.c_str() mpi_send function message of type std::string . in way, compiler complains. will mpi_send modify source? no, won't. my question why first parameter of type void * rather const void *. bad design. the first versions of mpi released after c has been standardized in 1989 , const available standard. a proposal add missing const mpi_send , other mpi functions submitted , accepted future mpi-3. https://svn.mpi-forum.org/trac/mpi-forum-web/ticket/140