Naming of Functions

I posted a question in the Q&A section on Udemy Someone told me to join the forum discussions here so I decided to. I am confused first by why we prefix our new function named SubmitGuess with BullCowCount also I am not sure why we put FString inside the parentheses “SubmitGuess(FString)”. Sorry if this is not a clearly asked question but I am new to coding and sort of unsure on the proper way to ask so any help is appreciated. Thank You.

Lets break down the statement BullCowCount SubmitGuess(FString); bit by bit.

BullCowCount here is the return type, that is the type that’s going to be returned (give back to whatever called this function) by this function.

SubmitGuess The name of the function

(FString) This is saying that the function has one parameter (something to be passed into the function) and that the type for that is FString. Since this is the declaration in the header file, the parameters don’t need a variable name, though it’s useful to do so as it should come up with intellisense. i.e it would look like

1 Like

Privacy & Terms