Is there any way to use std::pair and std::make_pair in C? seems that they are applicable in C++.
As I used
#include "utility"
it says it can not find such file
thansk for any suggestion
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
It’s C++-only. C has no templates, so you will have to roll your own with macros to emulate them to some extent, for example:
But it’s really not worth the trouble, result code is more verbose and less obvious than just using plain structs.