{"id":156,"date":"2021-09-03T01:59:36","date_gmt":"2021-09-03T01:59:36","guid":{"rendered":"https:\/\/lgildv5i97.onrocket.site\/answers\/programming-c-system-and-variables-11796-html"},"modified":"2021-09-03T03:02:06","modified_gmt":"2021-09-03T03:02:06","slug":"programming-c-system-and-variables-11796-html","status":"publish","type":"question","link":"https:\/\/computing.net\/answers\/programming\/c-system-and-variables\/11796.html","title":{"rendered":"C++ system() and variables?"},"content":{"rendered":"<p>Hello, i&#8217;m just messing around right now in C++ and i&#8217;m trying to make my own little &#8220;search&#8221; utility b\/c the one in windows xp is horribly slow and i&#8217;ve found with a batch file you can find the location of something like 100x faster then windows search can. so now i&#8217;m just trying to write a little program that will be more flexible then going into a batch file and changing a file name every time i want to find something \ud83d\ude42 however, for this i need to take in a variable and then include that in the system() command as the string. but i&#8217;m not sure how i&#8217;d do this.. as of now i tried:<\/p>\n<p>system(&#8220;dir \/s \/b | find \/i &#8220;&#8221; &lt;&lt; strng &lt;&lt; &#8220;&#8221; &gt; &#8220;c:shibbyfoundfile.shibby&#8221;&#8221;);<\/p>\n<p>but Dev-C++ tells me: &#8220;<i>error: invalid<br \/>\noperands of types `const char[22]&#8217; and `char[50]&#8217; to binary `operator&lt;&lt;&#8216;<\/i>&#8221; (i hope that displays properly. we&#8217;ll see in a minute.. but yea, does anyone know how i&#8217;d accomplish this task?<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","template":"","meta":{"inline_featured_image":false,"iawp_total_views":11},"question-category":[55],"question_tags":[],"class_list":["post-156","question","type-question","status-publish","hentry","question-category-programming"],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/computing.net\/answers\/wp-json\/wp\/v2\/question\/156","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/computing.net\/answers\/wp-json\/wp\/v2\/question"}],"about":[{"href":"https:\/\/computing.net\/answers\/wp-json\/wp\/v2\/types\/question"}],"author":[{"embeddable":true,"href":"https:\/\/computing.net\/answers\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/computing.net\/answers\/wp-json\/wp\/v2\/comments?post=156"}],"wp:attachment":[{"href":"https:\/\/computing.net\/answers\/wp-json\/wp\/v2\/media?parent=156"}],"wp:term":[{"taxonomy":"question-category","embeddable":true,"href":"https:\/\/computing.net\/answers\/wp-json\/wp\/v2\/question-category?post=156"},{"taxonomy":"question_tags","embeddable":true,"href":"https:\/\/computing.net\/answers\/wp-json\/wp\/v2\/question_tags?post=156"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}