Monday, August 12, 2013

fatal error LNK1123: failure during conversion to COFF: file invalid or corrupt

 Project Properties 
       -> Configuration Properties 
           -> Linker (General) 
              -> Enable Incremental Linking -> "No (/INCREMENTAL:NO)"
 
 
This is come from the http://stackoverflow.com and very useful! 

Saturday, July 27, 2013

A quick way to auto format code in visual studio 2012

Yesterday I learned how to auto format code in visual studio 2012 from my professor.
CTRL -K then CTRL -D.
It is easy and very useful.

Wednesday, July 10, 2013

Double Link List (part of the code)


//Moves the current pointer to the previous item of the list

void goPrev(){
        if(cur!=front){   // in case the current Node is the head of the list
          cur=cur->prev;
        }     
      }


 //sets the value within current item
 void setValue(int d){
        if(cur){
          cur->data =d;
        }       
      }


//in the DLLNode struct  add the constructor

DLLNode(int d,DLLNode* n, DLLNode* p):data(d),next(n),prev(p){}  


   //Insert a new node before or after the current item
     
void insertBefore(int d){

          if(cur){
            DLLNode* p = new DLLNode(d,cur,cur->prev);
            if(cur->prev){// the cur Node is not the head of the list
                if(p){
                    cur->prev->next =p;
                    cur->prev = p;
                }
            }
            else{  // the cur Node is the head of the list
                if(p){
                  cur->prev = p;
                  front = p;  // change the front to p
                }
          }        
      }
          else  // the list is empty
          {
              DLLNode* p = new DLLNode(d, NULL,NULL);
              if(p)
                front = back = cur = p;         
          }

        size++;
    }







visual c++ package: failed to load ?????

After the window update, the visual studio can not open any project and the error message showed "'visual c++ package': failed to load ".
After search google and found the solution:

1. click the TOOLS--->VISUAL STUDIO COMMAND PROMPT   to open the command window
2. input the command "devenv /Setup"
3. open the visual studio 2012 again, it will works.



Tuesday, July 09, 2013

How to set line number in visual 2012

Today I know how to set the line number in visual 2012

tool --> options --> Text editor--> c/c++ -->General -->display -- >click  line numbers