This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func GroupBy(data any) map[string][]ObjForGroupBy { | |
datas := reflect.ValueOf(data) | |
var result = make(map[string][]ObjForGroupBy) | |
l := datas.Len() | |
for i := 0; i < l; i++ { | |
obj := datas.Index(i).Interface().(ObjForGroupBy) | |
strV := obj.GetValueForGroupBy() | |
result[strV] = append(result[strV], obj) | |
} | |
return result |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <string> | |
#pragma warning(disable : 4996) | |
int main() { | |
FILE* stream; | |
std::string file_name = "c:\\abc\\uyhb.jpg"; | |
if ((stream = fopen(file_name.c_str(), "r")) == NULL) { | |
printf("failed\n"); |