Relative Content

Tag Archive for c++string

Creating an array of string pointers

I’ve reviewed many of the previous entries for this, but can’t figure out why my (seemingly simple) construct doesn’t work:
I want to create an array of pointers to previously-defined strings (char *). Here’s my
construct:

How to find all positions of multiple substrings within a string in C++

I want to use the #include directive in GLSL files so I don’t have to rewrite the same code for every GLSL shader I create. I tried to create my own small parser for this purpose, but I couldn’t find a good way to locate all #include statements in a GLSL file. I want to extract the paths of the included files, read them, and write their content into the actual shader (not the original GLSL file that uses the #include directive, but the content read into a std::string).

How to find all positions of multiple substrings within a string in C++

I want to use the #include directive in GLSL files so I don’t have to rewrite the same code for every GLSL shader I create. I tried to create my own small parser for this purpose, but I couldn’t find a good way to locate all #include statements in a GLSL file. I want to extract the paths of the included files, read them, and write their content into the actual shader (not the original GLSL file that uses the #include directive, but the content read into a std::string).

my code gives time limit reached please fix my code

Today while solving a question on leetcode, I applied dfs on a directed graph which runs on O(N) time, but my code is giving TLE, so after trying too many time I checked on comments and there was a accepted code which also runs on O(N). So now I am confused as why my code is not getting accepted and giving time limit exceeded. My code:-