mirror of
https://github.com/adambard/learnxinyminutes-docs.git
synced 2025-01-14 05:05:59 +00:00
Update bc.html.markdown (#4892)
The global variable syntax and the pre-set variable syntax is invalid. On bc 1.07.1 it produced syntactic errors. I modified the tutorial so that it doesn't include these syntaxes.
This commit is contained in:
parent
1baca665b8
commit
a74257f407
@ -41,15 +41,11 @@ if(hour < 12) { /*Operators are exactly like C.*/
|
|||||||
\t: tab
|
\t: tab
|
||||||
\\: backslash*/
|
\\: backslash*/
|
||||||
} else {
|
} else {
|
||||||
/*Variables are global by default.*/
|
print "Good afternoon\n"
|
||||||
thisIsGlobal = 5
|
|
||||||
/*You can make a variable local. Use the "auto" keyword in a function.*/
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*Every variable is pre-set to 0.*/
|
|
||||||
num = blankVariable /*num is set to 0.*/
|
|
||||||
|
|
||||||
/*Like C, only 0 is falsy.*/
|
/*Like C, only 0 is falsy.*/
|
||||||
|
num = 0
|
||||||
if(!num) {print "false\n"}
|
if(!num) {print "false\n"}
|
||||||
|
|
||||||
/*Unlike C, bc does not have the ?: operators. For example,
|
/*Unlike C, bc does not have the ?: operators. For example,
|
||||||
|
Loading…
Reference in New Issue
Block a user