We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
缺乏类型检查,什么都可以往里塞。 编译不报错,连warning也不报。
运行时报错
vector_t *pvec_strptr = create_vector(string_t); vector_init(pvec_strptr); string_t *pstr1 = create_string(); string_init(pstr1); string_assign_cstr(pstr1, "abc"); vector_push_back(pvec_strptr, pstr1); vector_push_back(pvec_strptr, "123"); vector_push_back(pvec_strptr, 123); vector_push_back(pvec_strptr, NULL); string_t *pstr2 = (string_t *)vector_at(pvec_strptr, 0); printf("%s ", string_c_str(pstr2)); vector_destroy(pvec_strptr);
The text was updated successfully, but these errors were encountered:
下面这个更神奇 运行都不报错
vector_t *pvec_charptr = create_vector(int); vector_init(pvec_charptr); char *p; short *q = NULL; vector_push_back(pvec_charptr, p); vector_push_back(pvec_charptr, q); vector_push_back(pvec_charptr, "ABC"); vector_push_back(pvec_charptr, 123); vector_push_back(pvec_charptr, NULL); vector_destroy(pvec_charptr);
Sorry, something went wrong.
No branches or pull requests
缺乏类型检查,什么都可以往里塞。
编译不报错,连warning也不报。
运行时报错
The text was updated successfully, but these errors were encountered: