<p>I have a class in system-C with some data members as such:  </p>

<pre><code>long double x[8];
</code></pre>

<p>I'm initializing it in the construction like this:</p>

<pre><code>for (i = 0; i &lt; 8; ++i) {
    x[i] = 0;
}
</code></pre>

<p>But the first time I use it in my code I have garbage there.</p>

<p>Because of the way the system is built I can't connect a debugger easily.  Are there any methods to set a data breakpoint in the code so that it tells me where in the code the variables were actually changed, but without hooking up a debugger?</p>

<p>Edit:
@Prakash: 
Actually, this is a typo in the <em>question</em>, but not in my code...  Thanks!</p>

[{'answer_id': 56336, 'author': 'Bobby Jack', 'author_id': 5058, 'author_profile': 'https://Stackoverflow.com/users/5058', 'pm_score': 3, 'selected': True, 'text': '<p>The trick is to combine a <code>UNION</code> with a literal string to determine the type of \'object\' returned. In most (?) cases, UNION ALL will be more efficient, and should be used unless duplicates are required in the sub-queries. The following pattern should suffice:</p>\n\n<pre><code> SELECT "group" type, name\n   FROM groups\n  WHERE name LIKE "%$text%"\nUNION ALL\n SELECT "user" type, name\n   FROM users\n  WHERE name LIKE "%$text%"\n</code></pre>\n\n<p><strong>NOTE</strong>: I\'ve added the answer myself, because I came across this problem yesterday, couldn\'t find a good solution, and used this method. If someone has a better approach, please feel free to add it.</p>\n'}, {'answer_id': 56346, 'author': 'hamishmcn', 'author_id': 3590, 'author_profile': 'https://Stackoverflow.com/users/3590', 'pm_score': 1, 'selected': False, 'text': '<p>If you use "UNION ALL" then the db doesn\'t try to remove duplicates - you won\'t have duplicates between the two queries anyway (since the first column is different), so UNION ALL will be faster.<br>\n(I assume that you don\'t have duplicates inside each query that you want to remove)</p>\n'}, {'answer_id': 56389, 'author': 'Josef', 'author_id': 5581, 'author_profile': 'https://Stackoverflow.com/users/5581', 'pm_score': 1, 'selected': False, 'text': "<p>Using LIKE will cause a number of problems as it will require a table scan every single time when the LIKE comparator starts with a %. This forces SQL to check every single row and work it's way, byte by byte, through the string you are using for comparison. While this may be fine when you start, it quickly causes scaling issues.</p>\n\n<p>A better way to handle this is using Full Text Search. While this would be a more complex option, it will provide you with better results for very large databases. Then you can use a functioning version of the example Bobby Jack gave you to <code>UNION ALL</code> your two result sets together and display the results.</p>\n"}, {'answer_id': 56423, 'author': 'Mark Nold', 'author_id': 4134, 'author_profile': 'https://Stackoverflow.com/users/4134', 'pm_score': 1, 'selected': False, 'text': '<p>I would suggest another addition</p>\n\n<pre><code> SELECT "group" type, name\n   FROM groups\n  WHERE UPPER(name) LIKE UPPER("%$text%")\nUNION ALL\n SELECT "user" type, name\n   FROM users\n  WHERE UPPER(name) LIKE UPPER("%$text%")\n</code></pre>\n\n<p>You could convert $text to upper case first or do just do it in the query. This way you get a case insensitive search. </p>\n'}]
['https://Stackoverflow.com/questions/56340', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/1084/']