I forgot () at the end of function call, but got no errors?

I forgot the () at the end of some function calls. I think that is an error, because there is nothing else with that name, but the IDE did not complain. But this happens only in if statement. Why?

Like this
if (!Swith14)
{
Dacout0(maxval*4);
}

I meant this:
if (!Switch14())
{
Dacout0(maxval*4);
}

I think that is an error, because there is nothing else with that name, but the IDE did not complain. But this happens only in if statement

if your question is calling funtion without () is error ? No, function name represents the starting memory address of it's. e.g

void blnk()
{
  digitalWrite(led, HIGH);   // turn the LED on (HIGH is the voltage level)
  delay(1000);               // wait for a second
  digitalWrite(led, LOW);    // turn the LED off by making the voltage LOW
  delay(1000);  
}
// the setup routine runs once when you press reset:
void setup() {                
  // initialize the digital pin as an output.
  pinMode(led, OUTPUT);     

}

// the loop routine runs over and over again forever:
void loop() {
  blnk;  //
  Serial.println();
               // wait for a second
}

here blnk; is the case and in your case Switch14 is starting value of function

Unfortunately, the way that the Arduino IDE drives gcc suppresses the warning messages that gcc can generate for that code.

In Cyberneticians answer what does the blnk line do? What I remember, for me, if (!Swith14) did not work the same way as with (). I have a function which gives no result and gets no parameters. But IDE does not give an error.

Example. This does not give an error myfunct;

if myfunct is void myfunct(void) ......

I cant test this now, I have to go elsewhere.

LMI: In Cyberneticians answer what does the blnk line do? What I remember, for me, if (!Swith14) did not work the same way as with (). I have a function which gives no result and gets no parameters. But IDE does not give an error.

Example. This does not give an error myfunct;

if myfunct is void myfunct(void) ......

I cant test this now, I have to go elsewhere.

The line " blnk; //" does nothing, same as "myfunct;" in your code. These are legal but useless C++ statements, which gcc will warn about if the usual warnings (-Wall) are enabled.

int btnPressed() {
    return digitalRead(12) == LOW;
}


void setup() {
    Serial.begin(115200);
    pinMode(12, INPUT);
    digitalWrite(12, HIGH);
}


void loop() {
    if (btnPressed) {                 // missing ()
        Serial.println("Pressed");
    }
    else {
        Serial.println("Not pressed");
    }
    delay(1000);
}

A function name on its own, i.e. without parentheses, represents the function address, not its return value. Therefore in the code above the if(btnPressed) statement will always take the "then" route, as a function address is never zero. But more importantly, it will do that regardless of the pin state.

a function address is never zero.

...except for this very important one used in the bootloader void (*app_start)(void) = 0x0000; ;)

;)

I don't know if this is the right way to do this or not. I'm a completely self taught programmer. But it works and uses the same syntax.

Most of my projects boil down to state machine code. I'll make an enum to name all the states and keep everything in arrays I can use those names to index. I'll register all the callbacks in an array of function pointers. So registering a callback might look like.

void someCallback()
{   ...  some code to run   }


callback_array[SOME_STATE] = someCallback;

Then the loop function might have:

if (callback_array[current_state]) callback_array[current_state]();

and someCallback will be called if current_state == SOME_STATE where current state is typed to the enum I made to hold the state names.

If a callback is not registered, then the array will have a NULL there and that will keep the function from being called. It gets paired up a lot with an else statement that adds a new callback function.

Hmmm... not bad for a self-taught programmer! :D

I'm using that technique too in a "app page" lib I'm working on atm...

But yes, a function pointer, like all pointers, can be NULL.