Questions tagged as 'sintaxe'

2
answers

Doubt with syntax

Simple doubts. Usually I see this syntax: require('../lib/dbconnect')(config); But I do not understand why I use these parentheses in this way. (....)(....); Can anyone explain what it's all about?     
asked by 15.10.2015 / 15:06
1
answer

Is it safe to use the new syntactic sugar for Javascript callbacks?

These days I was testing some Javascript features in Google Chrome 50 and I noticed that it has already been added to arrow function for callbacks. So: $.each([1, 2, 3], x => x * 2); // [2, 4, 6] Formerly it would have...
asked by 24.05.2016 / 19:49
1
answer

Program does not compile with miscellaneous errors

What is wrong here? I can not see the error. #include <stdio.h> void Main(void) { int a = 9; int b = 3; int c = 0; int *p = &b; c = a/*p; printf("%d \n", c); }     
asked by 08.12.2014 / 15:11
2
answers

Syntax error when trying to access static method on object stored in property!

In another one of my tests, I noticed that in PHP there is a problem when trying to access the static method of a class, when that class is instantiated in a property of another class; More specifically, I'm having problem with :: - Sco...
asked by 30.07.2015 / 17:58
2
answers

What is it for {} inside the main

I came across a C situation I do not know and had never seen anyone use before. Within the main() method there are several keys, I believe to isolate the code however there is a same variable that in each block of code receives a value an...
asked by 21.08.2018 / 22:06
1
answer

Why is a function calling itself?

def clinic(): print "Voce acabou de entrar na clinica!" print "Voce entra pela porta a esquerda (left) ou a direita (right)?" answer = raw_input("Digite left (esquerda) ou right (direita) e pressione 'Enter'.").lower() if answer =...
asked by 16.03.2017 / 01:05
1
answer

Why does "echo" accept parentheses in PHP?

In PHP, can echo receive parentheses because it considers this an expression? Apparently, some language features do not seem to be standardized and therefore can be used in a number of ways. For example: echo ('teste'); Or else:...
asked by 21.11.2018 / 16:02
1
answer

Why is it mandatory to use the ';' in the WITH clause?

I've always used WITH in my queries, however, I've never understood exactly why '; ' before the WITH clause is required. The error is very succinct, but gives an idea that WITH requires the previous statement to be clos...
asked by 27.10.2017 / 14:11
1
answer

Hello World in C ++ does not compile

I'm reading the book "Training in C ++ Language", but this teaching everything error. The hello world of the book simply does not compile: #include <iostream.h> void main() { cout << "Primeiro Programa"; } Follow the pict...
asked by 11.12.2014 / 23:24
1
answer

Why suppress zero before the decimal point, as in 0.5 == .5?

Sometimes I see a code in which the programmer has written a non-zero decimal, such as 0.5 being .5 , for example: var decimal1 = 0.5; var decimal2 = .5; console.log(decimal1 == decimal2); console.log(decimal1, decimal2);...
asked by 17.07.2018 / 15:15