[#BloombergLP-ball-RuleSet-getRuleById]
= xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/ball.adoc[ball]::xref:BloombergLP/ball/RuleSet.adoc[RuleSet]::getRuleById
:relfileprefix: ../../../
:mrdocs:

Return the address of the rule having the specified `id` if such a rule exists, and 0 otherwise&period; The behavior is undefined unless `0 &lt;&equals; id &lt; maxNumRules()`&period; Note that rules may be assigned non&hyphen;sequential identifiers, and that there may be a valid rule whose identifier is greater than `numRules()` (i&period;e&period;, valid rules may appear anywhere in the range `0 &lt;&equals; id &lt; maxNumRules()`)&period;

== Synopsis

Declared in `&lt;ball&lowbar;ruleset&period;h&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
xref:BloombergLP/ball/Rule.adoc[Rule] const*
getRuleById(int id) const;
----


[.small]#Created with https://www.mrdocs.com[MrDocs]#
