The initialization of SD card

According to this code,what will happen next if the initialization of SD card failed ? In other word, what return doing here ?

if(!SD.begin()) {
// display error message
return; }

In other word, what return doing here ?

Who knows? Take your snippets to http://snippets-r-us.com for help with them.

Here, we expect you to post ALL of your code.

The return statement causes the function that is in to end. Anything that follows the return statement is not executed. Since we can't see what is after the } in your code, we can't tell you what isn't executed, so we can't tell you the effect of the return statement.

May I suggest to begin by looking in-depth to simple formats of the conditionals:

IF- THEN - ELSE

and

WHILE

perhaps

CASE

You can find them on the net. I dare to say youtube is somehow more intuitive, but any information source is OK, depending on personal taste.

Myself I feel a bit lost handling more elaborated or shorthanded commands.

====

Basically, one may think like this:

IF

It rains - Check whether TRUE OR FALSE. If true

THEN

I stay home

ELSE

I go out to meet my friends for one hour.

:-))

You can imagine that, according to the above algoritm, that only if if it does NOT rain, you will go out.

However, the fragment above has no start and no stop. So nobody can say what will happen after you finish your encounter with your friends. Nor what happened before you check the rain.

Another point to note is that the above algoritm assumes that the rain will stop eventually. If not, you will keep looking through the window, to the rain, all day long. :-(. To what moment? We cant know from this algoritm, we shall add some exit-point. But for the moment, lets assume the rain will stop in some moment of the day. :slight_smile:

So:

START (wake up in the morning)

Coffee Routine

IF

It rains

THEN

I stay home

ELSE

I go out to meet my friends for one hour.

:-))

Make homework routine

STOP (go to bed)

Now, everybody can see what happened during the entire day :-)))

I learn in baby steps :-). Please forgive me for I am not "suit and tie" academic.

falexandru:
IF- THEN - ELSE

There is no THEN in C++.

Also, you can't capitalize if and else .

falexandru:
CASE

Isn't much use without switch.

falexandru:
I dare to say youtube is somehow more intuitive

I very much disagree. I want a text reference where I can find what I need without having to sit though a 20 minute video. You will find bad information anywhere on the Internet but I think there is especially a lot on Youtube. I think of it more as a source of entertainment, not information. There are some things that lend themselves well to videos and youtube is great for that but I just can't see any benefit to watching a video on programming.