<p>The enum <code>ScriptError</code> is defined in <a href="https://github.com/bitcoin/bitcoin/blob/master/src/script/script_error.h">https://github.com/bitcoin/bitcoin/blob/master/src/script/script_error.h</a>, and the <code>*</code> means that <code>set_success</code> requires you to pass a pointer to an enum value rather than the enum value itself.</p>

<p>I have to tell you, however, that if you are asking questions like "What does the "*" mean?", then you are going to have a hard time understanding C++ code.  I highly recommend doing some tutorials on C++ programming before going any further.</p>

CC BY-SA 3.0
2016-06-27T17:11:35.380Z
I  know about pointers I was just disturbed by the fact that it is wrote "ScriptError*" and not "*ScriptError"
smoumou
CC BY-SA 3.0
2016-06-27T17:22:11.840Z
`*ScriptError` would mean dereferencing a variable named "ScriptError".  For example, see line 25 interpreter.cpp, where `ret` is dereferenced in order to assign a new value.  I think you are thinking of writing `set_success(ScriptError* ret)` like `set_success(ScriptError *ret)`, instead.  In C++, both mean the same thing.
Jestin
CC BY-SA 3.0
2016-06-28T11:13:08.400Z
Do you understand what is happening line 167 ?
smoumou
CC BY-SA 3.0
2016-06-28T11:16:25.697Z
std::vector<unsigned char> vchSigCopy(vchSig.begin(), vchSig.begin() + vchSig.size() - 1);
smoumou
CC BY-SA 3.0
2016-06-28T12:28:44.603Z
It's creating a copy of `vchSig` called `vchSigCopy`.  However, it's neither possible nor appropriate for me to teach you C++ in the comments.  Some of these questions you've been asking are very fundamental concepts in C++.  You really need to take some time to learn the language if you want to understand Bitcoin's code.
Jestin
CC BY-SA 3.0
2016-06-27T16:59:40.060Z
2016-06-27T16:59:40.060Z
Jestin
<p><a href="https://github.com/bitcoin/bitcoin/blob/master/src/script/interpreter.cpp">https://github.com/bitcoin/bitcoin/blob/master/src/script/interpreter.cpp</a> </p>

<p>Line 22 => Where is declare "ScriptError" ? What does the "*" mean ? </p>

<pre><code>           "inline bool set_success(ScriptError* ret)"
</code></pre>

<bitcoin-core>
Question on interpreter.cpp in Bitcoin core - set_success method
smoumou
# Question on interpreter.cpp in Bitcoin core - set_success method

(Asked by: username_0 on 2016-06-27)

<https://github.com/bitcoin/bitcoin/blob/master/src/script/interpreter.cpp>

Line 22 => Where is declare "ScriptError" ? What does the "\*" mean ?

```
           "inline bool set_success(ScriptError* ret)"

```

**Tags:** bitcoin-core


---

## 1 answers

### Answer by username_1 on 2016-06-27. Score: 8 | Accepted answer

The enum `ScriptError` is defined in <https://github.com/bitcoin/bitcoin/blob/master/src/script/script_error.h>, and the `*` means that `set_success` requires you to pass a pointer to an enum value rather than the enum value itself.

I have to tell you, however, that if you are asking questions like "What does the "\*" mean?", then you are going to have a hard time understanding C++ code. I highly recommend doing some tutorials on C++ programming before going any further.

> **Comments:**
> **username_0**: I  know about pointers I was just disturbed by the fact that it is wrote "ScriptError*" and not "*ScriptError"  
> **username_1**: `*ScriptError` would mean dereferencing a variable named "ScriptError".  For example, see line 25 interpreter.cpp, where `ret` is dereferenced in order to assign a new value.  I think you are thinking of writing `set_success(ScriptError* ret)` like `set_success(ScriptError *ret)`, instead.  In C++, both mean the same thing.  
> **username_0**: Do you understand what is happening line 167 ?  
> **username_0**: std::vector<unsigned char> vchSigCopy(vchSig.begin(), vchSig.begin() + vchSig.size() - 1);  
> **username_1**: It's creating a copy of `vchSig` called `vchSigCopy`.  However, it's neither possible nor appropriate for me to teach you C++ in the comments.  Some of these questions you've been asking are very fundamental concepts in C++.  You really need to take some time to learn the language if you want to understand Bitcoin's code.  

---

