switch

switch for std:: string C++

Dear Gurus, tell me, is this approach acceptable for practical application: #include <functional> #include <iostrea ... ut: Assigning Derived_1 Assigning Derived_2 Assigning Derived_1 Assigning Derived_2 Assigning Derived_1 Assigning Derived_2

Creating Random objects WITHOUT duplicate objects

.Hello, good people. My task is to randomly determine the number of so-called survivors and list them. The problem is that th ... nt deletion of the object selected by random, but it did not work. I will be glad to hear the options your decisions. Thanks.

String comparison via the Java switch statement

I need to compare the value that is in the object with each value from the prepared array. How do I do this? In my case, it g ... ch (text) { case labelsStr[0]: startActivity(new Intent(context, Color.class)); break; }

The simplest calculator in JavaScript. I can not understand why the code does not work, tell me, illiterate)

<script> function a() { var a1 = parseInt(document.getElementById('a1').value); ... tarea сols="20" rows="1" id="count" ></textarea> </p> </div> </body> </html>

Jquery Menu Toggle Switch Hide Element fa fa-bars

Please help, I can't hide the icon of the closing menu under the hamburger, so that it appears when you click on the toggle s ... </ul> </div> </nav> </header> </div> </body> </html>

How to throw IllegalArgumentException if the slot value is incorrect

I have a Player class and it has a shotWithWeapon method, I need to throw an IllegalArgumentException exception if the slot v ... gumentException, если значение slot некорректно Weapon weapon = weaponSlots[slot]; weapon.shot(); } }

switch case C++

Why doesn't this code work? Really in C++ switch does not accept the string type this is some nonsense. string text; cin> ... << "Some output"; break; default: std::cout<<"Input incorrect!"; break; } return 0;

Selecting a city from the list

Good afternoon. The task is as follows. It is necessary that the content (namely, addresses, phone numbers, and a map) change ... emselves, and not from the divs. Somewhere the selected city is not hidden from the list, etc. Tell me how to implement this.

Problem with switch in js

Please tell me what could be wrong?The logic is this: when you click on one of the icons (". icon"), I take it value and then ... src="media/pencil_image.png" alt="pencil" class="icon" value="2"></li> </ul> </ul> </div>

What difference between return and break in a switch case?

In some situations the practice ofswitch case for code optimization and improvement. I have an application developed for Andr ... t I did not understand exactly what diverges from each other. What real difference between return and break in a switch case?

Java Switch case ends for no reason

I have an example of switch-case with 8 options. But from case 7 it ends the program. It was for him to go back to the menu o ... default: System.out.println("default "); break; } } } }

Determining a string inside a switch in C

I have doubt on how to set a string inside a switch in C, without having to make a table of constants for this. The varia ... be empty before the switch and after the pass through the switch if the case is true this would receive the designated value.

Exchange elseif code for switch case

I'm having trouble changing a code I made in else if to switch case. I'm not getting the code to work, it gets values and ope ... $result = $num1*$num2; else $result = $num1/$num2; echo "O resultado é: ".$result; } }

how to use a switch within a switch?

In case I can't choose the select difficulty menu option, am I doing the right way the switch within a switch? #include < ... ALIDA."); printf("\n\n\t\t\tOPCAO DESEJADA:"); scanf("%c", &opcao); break; } }

How to use switch in C?

I have to understand this code that my advisor passed to me. Is The opt after switch required? The break command too? Why ... tf(stderr, "%s \nparametros:\n-e arquivo de entrada\n-s arquivo de saida\n", argv[0]); exit(EXIT_FAILURE); }

What is a loose comparison?

In the PHP documentation , about switch it says: Note : Note that switch / case does loose comparison. What is a loose comparison? And what is the difference between a loose comparison and a rigid one?

Use an operator in a switch case

If I do, wheel Good: #include <stdio.h> int op1; int main(){ scanf("%d", &op1); switch(op1) { case 1: ... this: #include <stdio.h> int op1; int main(){ scanf("%d", &op1); switch(op1) { case +: puts("ola"); } }

Is it wrong to use multiple cases for the same action on the switch?

Is it wrong to do this with switch? I programmed it like that with him, is it wrong? switch(estado){ case "AL": case "BA" ... DO NORDESTE break; case "ES": case "MG": case "RJ": case "SP": //FAZ ALGO AQUI PARA TODOS OS CASES DO SUDESTE break; etc...

How to receive a string and by switch do the check in C?

I have to develop an algorithm that gets the name of a place, for example, "School", and based on this, do a check of the str ... C the concept of string is very different, and it turns out to be more like a array than string , being vague the concept

Switch case in Submit button according to button ID

I have 7 submit buttons in a form. Being: Four of that: <input type="submit" id="chamado1" class="mr-abre-btn" value=" ... 10242264{main}( )...\formulari.php:0 20.0111307088include( 'C:\wamp64\www\form\formulario.php' )...\formulario.php:44 ">