Most voted "syntax" questions
Syntax is the set of rules that defines how the different symbols of a language (natural or programming) can combine validly.
Learn more…268 questions
Sort by count of
-
4
votes1
answer3377
viewsWhy is the use of ';' mandatory in the WITH clause?
I’ve always used the WITH in my consultations, however, I never understood exactly why is required the ';' before the clause WITH. The Error is very succinct, but it gives an idea that the WITH…
-
4
votes2
answers317
viewsWhy does "echo" accept parentheses in PHP?
In PHP, the echo can you receive parentheses because you consider that an expression? Apparently, some language features do not seem to be standardized and can therefore be used in numerous ways.…
-
4
votes1
answer97
viewsWhat does the ">" operator do in the middle of an arithmetic expression in C++?
I found this line of code in a proposed solution to a certain problem. excedente = a % 10 + b % 10 + excedente > 9; My point is, what function is that the > 9 makes this line me specific?…
-
4
votes1
answer62
viewsWhat would be the 'right' way to declare variables in PHP OO?
I’m starting to study O and fall into the following doubt: <?php class Caneta { var $modelo; var $cor; var $ponta; var $carga; var $tampada; } OR SO: <?php class Caneta { public $modelo;…
-
4
votes2
answers1473
viewsWhat is the difference between % and % in C?
What’s the difference between using the % and the %% in the C language?
-
3
votes1
answer144
viewsProgram does not compile with miscellaneous errors
What’s wrong here? I can’t 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); }…
-
3
votes1
answer183
viewsHello World in C++ does not compile
I am reading the book "C++ Language Training", but this teaching all wrong. The hello world of the book simply does not compile: #include <iostream.h> void main() { cout << "Primeiro…
-
3
votes2
answers577
viewsMysql, doubt about variables
Mysql allows using various type of syntax in variable declaration ex: declare i int unsigned default 0; set @str = "select "; Has some advantage in using one type or another, or some disadvantage or…
-
3
votes2
answers126
viewsSyntax error when trying to access static method on object saved in property!
In another 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…
-
3
votes2
answers46
viewsDoubt with syntax
Simple doubt. Usually I see this syntax: require('../lib/dbconnect')(config); But I don’t understand why I use those parentheses like that (....)(....); Can someone explain to me what this is all…
-
3
votes1
answer112
viewsIs it safe to use the new syntactic sugar for Javascript callbacks?
These days I was testing some Javascript features on Google Chrome 50 and I realized that it’s already been added to arrow function for callbacks. Thus: $.each([1, 2, 3], x => x * 2); // [2, 4,…
-
3
votes2
answers96
viewsHow to make Netbeans recognize the ES2015 syntax?
How to use the Netbeans with the ES2015? I’ve done some testing with Netbeans 8.0.1 and 8.0.2, but does not recognize the new syntax: let, const, etc..…
-
3
votes4
answers17399
viewsAverage between 3 notes
I need the user to enter 3 notes to calculate the average, and tell if he is approved, failed, or recovery. I believe the error is in the average itself. <html> <head> <title>…
-
3
votes2
answers109
viewsCustom typing
According to the DOC Type handling, the conversions allowed are: (int), (integer) - molde para inteiro (bool), (boolean) - converte para booleano (float), (double), (real) - converte para número de…
-
3
votes2
answers715
viewsWhat does && ! mean in PHP?
I am trying to know this, but it appears nowhere. There is a gap between & & e !. if ( is_home() && ! is_front_page() )
-
3
votes1
answer1292
viewsWhy 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…
-
3
votes3
answers318
viewsDifference between properties syntax in C#
For what I researched, if I do: public int numero { get; set; } is the same thing as: private int numero; public int Numero { get{ return numero; } set{ numero = value; } } But in the first chunk of…
-
3
votes1
answer60
viewsWhy are boolean values converted to string in the case Camel in C#?
Today I came across a peculiarity of C# which I had never stopped to pay attention to: When converting a value bool for string, the result is a text in Camel case: string verdadeiro =…
-
3
votes1
answer37
viewsWhy can I invoke functions without parentheses in VB.NET?
In C#, this code does not compile: public static string Teste(){ string val = ""; return val.Trim; } Because the function Teste requires a return of the type string, and Trim is a MethodGroup. That…
-
3
votes1
answer300
viewsCan I place two conditions/increments within the same loop?
I want to basically do this for (j = parametro, int k=0; j < parametro + 3, k<3; j++, k++) { previsoes[i] += valores[j] * pesos[k] ; }
-
3
votes2
answers116
viewsIs that a Property, class attribute or what?
I have it in my code: public ICommand ChangePositionCommand => new Command((obj) => { _positionIndex++; if (_positionIndex >= Positions.Count) _positionIndex = 0; Position =…
-
3
votes1
answer3131
views -
3
votes1
answer60
viewsSyntax ':value' in the array
I saw this syntax in the 'Resources/lang' area, where authentication messages are preset. And I came across the following code: <?php return [ 'throttle' => 'Too many login attempts. Please…
-
3
votes1
answer93
viewsWhat are the advantages of using "currying" in a function?
I understand that, roughly speaking, to use currying is to break a function that takes several arguments into smaller functions that receive only parts of the arguments of the original function.…
-
3
votes1
answer108
viewsIncorrect Usage of UNION and LIMIT
I want my query to return only the first record of the first table (if there is data in it), because the second table has no repeated data. But he returns this mistake: Error Code: 1221. Incorrect…
-
3
votes2
answers265
viewsWhat is the globally accepted standard in programming languages?
In the Portuguese language in Brazil we use ABNT if we want to elaborate a highly correct and precise text before the norms, and to make itself understood before the words we use the dialectic. In…
-
3
votes0
answers47
viewsStrange expressions in PHP
Someone explains why this: <?php $world = _("World"); $str = <<<EOF <p>Hello</p> <p>$world</p> EOF; echo $str; ?> generates this: Hello World error-free? what…
php characteristic-language encoding-style syntax certifiedasked 6 years, 9 months ago Julio Henrique 4,352 -
3
votes1
answer90
viewsWhat are considered operators in the programming language?
I was wondering if a token is considered an operator when performing an action?
characteristic-language operators syntax language-independent tokenasked 5 years, 1 month ago Hyago M. Vale 33 -
3
votes1
answer112
viewsHow does Python identify which commands are inside if?
In C we have how to inform the size, or how far the function is present as for example: if (n > 2){ ... } but in Python is if n > 2: ... I would like to understand how far these functions end…
-
3
votes2
answers122
viewsWhat is it for { } inside the main
I came across a situation in C that I do not know and had never seen anyone use before. Within the method main() there are several keys, I believe that to isolate the code but there is a same…
-
3
votes1
answer198
viewsHow to create multi-line strings in C++
Have some way to print output, for example a text, without having to print line by line? For example, in Python: print(""" Meu nome eh Guilherme, tenho 19 anos, faço aniversário em Nov. Estudo o…
-
3
votes1
answer52
viewsWhat does this point in the structure code mean?
int main(){ char buff[129]; WSADATA wsa; WSAStartup(MAKEWORD(2, 0), &wsa); struct sockaddr_in caddr; struct sockaddr_in saddr = { .sin_family = AF_INET, …
-
3
votes2
answers54
viewsWhat does the # operator do before a parameter in the definition of a macro?
One of the possible macro definitions assert(), as I found in Mingw’s code,. #define assert(_Expression) \ (void) \ ((!!(_Expression)) || \ (_assert(#_Expression,__FILE__,__LINE__),0)) I don’t…
-
3
votes1
answer62
viewsDifference of {} and = in a declaration
What is the difference of two statements? On what occasions should I use each one? - int Num{15}; - int Num = 15;
-
3
votes1
answer58
viewsIs it recommended to use typedef in C++?
I know C++ is compatible with C, but C++ has its own way of programming and C as well, so there are legacy things from C that shouldn’t be used in C++, the typedef is one of them? If yes, what to…
-
2
votes2
answers1830
viewsPerformance in Java repeat loops
What is the difference in performance between the three types of ties highlighted below. List<Foo> list = new ArrayList<Foo>(); for (int i = 0; i < list.size(); i++) { //CODE } for…
-
2
votes2
answers100
viewsHow to know if a Nsarray is empty (or void) using IF
I need to know if a Nsarray is empty or void using an if. Code: NSArray* array; if( array == nil) { // Fazer algo }
-
2
votes1
answer126
viewsWhat does this "people[last, first]" mean in Python?
It’s the first time I’ve seen this syntax people[last, first] with the comma separating the Dexes in Python. I don’t even know what data structure is people. The question is What does this statement…
-
2
votes2
answers155
viewsDifferences between arrays declarations
What’s the difference between declaring a matrix like this: 'C# string MinhaMatriz[] = [] 'VB Dim MinhaMatriz() As String = { } and so: 'C# string[] MinhaMatriz = [] 'VB Dim MinhaMatriz As String()…
-
2
votes1
answer1600
viewsConcatenate columns and some with NULL value
I’m making a select and concatenating the columns, when a column has value NULL (has no value ) the whole line is NULL follows an example: select…
-
2
votes1
answer1010
viewsPostgresql syntax error using keys
I’m having trouble understanding why pgadmin is pointing syntax error in my query. select first_name, coalesce(to_char(avg(p.amount),'99.99'), 'nnn') valor_medio from { select c.first_name as…
-
2
votes1
answer137
viewsIs there a free algorithm to check syntax C#?
I’m creating a small text editor that has C#code. There is some way inside the program itself, independently, to check if the syntax is correct? Note: I am not using C# to do the text editor. I am…
-
2
votes1
answer2466
viewsEmpty list matrix initialization "{ }" in C++
From what I have seen, it is possible to initialize a vector with the empty list, in C++, but not in C, so that all vector elements are 0: int meuVetor[10] = {}; // Todos os elementos 0, em C++ What…
-
2
votes2
answers69
views -
2
votes0
answers203
viewsWhat is the difference between function expression and function definition in relation to Hoisting in Javascript?
What is the difference between function expression (named or unspecified) and function definition in relation to Hoisting no Javascript? Named function expression syntax: var somar = function…
-
2
votes0
answers99
viewswxmaxima. Defining a function of three variables
I’m trying to do some symbolic/algebraic calculations in wxmaxima. But I’m having syntax problems. Question. Let 'n' and’m' be previously stipulated integers. What is the syntax/'command line', as…
-
2
votes3
answers191
viewsLogical operator || in C# does not work
I’m trying to do an exercise where in a range of 0 to 30 I want to know which numbers are divisible by 3 or 4. Working with a if for every situation works. But if I try to use the logical operator…
-
2
votes0
answers38
viewsPHP Parse error: syntax error, Unexpected '[' - PHP 5.3.29
I have an application running perfectly locally. But when I played it online I keep getting the following message and I have no data return. PHP Parse error: syntax error, Unexpected '[' in…
-
2
votes2
answers190
viewsHow to know the difference between language construction and function in PHP?
How to identify and what is the difference between a language construction and a function?
-
2
votes0
answers28
viewsSQL command denied to user selector
I am trying to update my database, and set the Visible of all these vouchers to 0, I am using ide for the command and it accuses an error and I believe it is at syntax, someone can help me? UPDATE…