Search Result

Collapse
5 results in 0.0042 seconds.
Keywords
Members
Tags
switch
  •  

  • CPP freshman
    started a topic switch no default output
    in C

    switch no default output

    I tried this example:
    Code:
    void testSwitch(){
      for(int i=1;i<8;i++){
        cout<< i: <<i<< is ;
        switch(i){
          case 1: cout<<1; break;
          case 5: cout<<5; break;
          case 6: cout<<6; break;
          case 4: cout<<4; break;
    defaut: cout<<0; break;
        }
        cout<<endl;
      }
    }
    and the output...
    See more | Go to post

  • ahumam0
    started a topic using (char*) in switch statment
    in C

    using (char*) in switch statment

    Hello everybody.
    I am new in C programming language and have an (if satament) and need to transfer it into switch statment.
    My problem is that I have a field named (node_kind) of char* type and I compare it's content in the if statment using (strcmp) but I don't know how to do that in the switch statment.
    Would you plz tell me how ?
    Here is a short quote of my program

    Code:
    if (strcmp(node->node_kind, "VAR_TOKEN_e")
    ...
    See more | Go to post

  • can not rectify the problem, initialization of file skipped by case label.

    Code:
    #include<iostream>
    #include<string>
    #include<iomanip>
    #include<fstream>
    #include"directory.h"
    #include"mylog.h"
    
    using namespace std;
    // function to input the word to be searched
    string input(void)
    {
    string wordin;
    cout<<"enter a word to be searched"<<endl;
    cin>>wordin;
    return wordin;
    ...
    See more | Go to post

  • SKbirdie
    started a topic Nested If/else in JS with <a href actions.

    Nested If/else in JS with <a href actions.

    I am writting a large if / else tree in an existing website. My include libraries have to be put into the html program using a scripting language called SpeedScript. These includes bring in the login data that I am testing in my if tree. Instead of using the if/else I am trying a switch.

    I need to know how to write this if/else tree / switch statement. I am brand new to Javascript. Here is the code I currently have that is not working....
    See more | Go to post
    Last edited by Dormilich; Aug 26 '10, 11:36 PM. Reason: Please use [code] tags when posting code

  • Sfreak
    started a topic Customized Shortcuts

    Customized Shortcuts

    Hi there,

    Im trying to implement a way to set the shortcuts defined by the user.

    Im using NHibernate and my model class returns me fields in Keys type (Keys is an Enum that contains the name of the keys. example: Keys.F1)

    I have implemented it in a static way and the code is the following:
    Code:
    internal void set_shortcuts (KeyEventArgs e)
    {
                switch (e.KeyCode)
    ...
    See more | Go to post
Working...