What about the problem of "no matching symbolic information found"in this function?

This is a discussion on What about the problem of "no matching symbolic information found"in this function? within the C Programming forums, part of the General Programming Boards category; Code: The code: #include<stdio.h> #include<stdlib.h> #define MaxSize 50 char postexp[MaxSize]; typedef struct{ char elem[MaxSize]; int top;}SqStack; void InitStack(SqStack *&s) {s=(SqStack ...

  1. #1
    Registered User
    Join Date
    May 2009
    Posts
    9

    Question What about the problem of "no matching symbolic information found"in this function?

    Code:
    The code:
    
    #include<stdio.h>
    #include<stdlib.h>
    #define MaxSize 50
    char postexp[MaxSize];
    typedef struct{
            char elem[MaxSize];
            int top;}SqStack;
    void InitStack(SqStack *&s)
    {s=(SqStack *)malloc(sizeof(SqStack));
    s->top=-1;}
    int push(SqStack *&s,char e)
    {if(s->top==MaxSize-1) return 0;
    s->top++;
    s->elem[s->top]=e;
    return 1;}
    
    void trans(char *exp)
    {SqStack *s;int i=0;
    while(*exp!='\0')
    {switch(*exp)
    {case '(':push(s,*exp);exp++;break;
     case ')':while(s->elem[s->top]!='(')
     {postexp[i++]=s->elem[s->top];
         s->top--;}
        s->top--;exp++;break;
     case '*':
     case '/':if(s->elem[s->top]=='*'||s->elem[s->top]=='/')
         postexp[i++]=s->elem[s->top];
              s->top--;push(s,*exp);exp++;break;
     case '+':
     case '-':while(s->top!=-1&&s->elem[s->top]!='(')
        {postexp[i++]=s->elem[s->top];s->top--;}
      push(s,*exp);exp++;break;
     case ' ':exp++;break;
     default:while(*exp>='0'&&*exp<='9')
       {postexp[i++]=*exp;exp++;}
      postexp[i++]='#';}}
    while(s->top!=-1)
    {postexp[i++]=s->elem[s->top];
    s->top--;}
    postexp[i]='\0';
    
    }
    
    void main()
    {SqStack *s;char exp[]="2+3*4/(5+6)";
    InitStack(s);
    trans(exp,postexp);
    gets(postexp);
    }
    
    
    
    Compile with  VC seems OK
    but the running process throws exception,
    and debug information as follows:
    
    Loaded symbols for 'H:\Visual C++ 6.0\新建文件夹\MSDev98\MyProjects\EXP\Debug\EXP.exe'
    Loaded 'C:\WINDOWS\system32\ntdll.dll', no matching symbolic information found.
    Loaded 'C:\WINDOWS\system32\kernel32.dll', no matching symbolic information found.
    Loaded 'C:\WINDOWS\system32\version.dll', no matching symbolic information found.
    Loaded 'C:\WINDOWS\system32\msvcrt.dll', no matching symbolic information found.
    Loaded 'C:\WINDOWS\system32\advapi32.dll', no matching symbolic information found.
    Loaded 'C:\WINDOWS\system32\rpcrt4.dll', no matching symbolic information found.
    Loaded 'C:\WINDOWS\system32\secur32.dll', no matching symbolic information found.
    Loaded 'C:\WINDOWS\system32\user32.dll', no matching symbolic information found.
    Loaded 'C:\WINDOWS\system32\gdi32.dll', no matching symbolic information found.
    Loaded 'C:\WINDOWS\system32\shlwapi.dll', no matching symbolic information found.
    Loaded 'C:\WINDOWS\system32\imm32.dll', no matching symbolic information found.
    Loaded 'C:\WINDOWS\system32\lpk.dll', no matching symbolic information found.
    Loaded 'C:\WINDOWS\system32\usp10.dll', no matching symbolic information found.
    Loaded 'C:\WINDOWS\system32\apphelp.dll', no matching symbolic information found.
    The thread 0xF08 has exited with code 0 (0x0).
    
    
      How dizzy I am to find out the problem .Any friend can help me?

  2. #2
    and the hat of copycat stevesmithx's Avatar
    Join Date
    Sep 2007
    Posts
    501
    Please indent the code properly otherwise it is too hard for others to read your code.
    Compile with VC seems OK
    Hmm,that's odd as there are a couple(or more) of syntax errors in the code.
    Code:
    void InitStack(SqStack *&s)
    should probably be,
    Code:
    void InitStack(SqStack *s)
    Also,function trans() takes only one argument instead of two.
    and order of certain statements in main() is probably wrong.[Normal flow of execution is from top->bottom in structural programming].
    Use of gets() should be avoided so is void main().
    Not everything that can be counted counts, and not everything that counts can be counted
    - Albert Einstein.


    No programming language is perfect. There is not even a single best language; there are only languages well suited or perhaps poorly suited for particular purposes.
    - Herbert Mayer

  3. #3
    and the hat of wrongness Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    32,673
    There's nothing wrong with your setup (well, nothing which prevents you debugging it at any rate).

    > Loaded symbols for 'H:\Visual C++ 6.0\新建文件夹\MSDev98\MyProjects\EXP\Debug\EXP.exe'
    This is good, you can debug your code.

    > The thread 0xF08 has exited with code 0 (0x0).
    This means your program finished normally.

    > Loaded 'C:\WINDOWS\system32\kernel32.dll', no matching symbolic information found.
    This just means that IF you really wanted to single step your way right the way down to the kernel, that you would have a hard time when you got there.
    Unless you have specific problems within these DLLs (not likely for a beginner), then you can ignore these kinds of warnings. They don't prevent you from running and debugging your own code.
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.
    I support http://www.ukip.org/ as the first necessary step to a free Europe.

  4. #4
    Registered User
    Join Date
    May 2009
    Posts
    9

    Smile

    Code:
    I changed  my  former  code  and  it  shows as follows ,compiling  and  running with VC shows OK  this time!
    It is  because  some  semanteme error in function  which lead to dead recycle  I think!
    
    #include<stdio.h>
    #define MaxSize 50
     
    void trans(char *exp,char postexp[])
    { struct
       {char elem[MaxSize];
    	int top;
         }s;
    	
       s.top=-1;
    	int i=0;
    while(*exp!='\0')
    {switch(*exp)
    {case '(':s.top++;s.elem[s.top]=*exp;exp++;break;
     case ')':while(s.elem[s.top]!='(')
              {postexp[i++]=s.elem[s.top];
    	      s.top--;
    	                  }
    	     s.top--;
                     exp++;break;
     case '*':
     case '/':if(s.elem[s.top]=='*'||s.elem[s.top]=='/')
    	{postexp[i++]=s.elem[s.top];s.top--;}
    	 s.top++;s.elem[s.top]=*exp;      
    	 exp++;break;
    case '+':
    case '-':while(s.top!=-1&&s.elem[s.top]!='(')
               {postexp[i++]=s.elem[s.top];s.top--;}
                   s.top++;s.elem[s.top]=*exp;
                        exp++;break;
    	case ' ':exp++;break;
    default:while(*exp>='0'&&*exp<='9')
                   {postexp[i++]=*exp;exp++;}
    	postexp[i++]='#';
                          }
                     }
    while(s.top!=-1)
    {postexp[i++]=s.elem[s.top];
    s.top--;
            }
    
    postexp[i]='\0';
    
           }
    
     void main()
    {char exp[]="2+3*4/(5+6)";
    char postexp[MaxSize];
    trans(exp,postexp);
    puts(postexp);
    }

  5. #5
    and the hat of wrongness Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    32,673
    You're still using void main
    Your indentation still sucks.
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.
    I support http://www.ukip.org/ as the first necessary step to a free Europe.

  6. #6
    Registered User
    Join Date
    May 2009
    Posts
    9
    Quote Originally Posted by Salem View Post
    You're still using void main
    Your indentation still sucks.
    I think next time I will be more conscious about it.I'm a chinese student and is perparing for Postgraduate entrance exam majored in computer science .
    I really interested in it. Thanks very much for your attention ,Salem!
    Last edited by Salem; 06-01-2009 at 10:52 PM. Reason: Please stop using code tags for everything, just use them for the actual code.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Bisection Method function value at root incorrect
    By mr_glass in forum C Programming
    Replies: 3
    Last Post: 11-10-2005, 08:10 AM
  2. Tab Controls - API
    By -KEN- in forum Windows Programming
    Replies: 7
    Last Post: 06-02-2002, 09:44 AM
  3. Database Access Problem
    By Prog.Patterson in forum Windows Programming
    Replies: 11
    Last Post: 05-06-2002, 10:46 AM
  4. C++ Compiler Problem
    By Prog.Patterson in forum C++ Programming
    Replies: 0
    Last Post: 05-02-2002, 10:17 AM
  5. I need help with passing pointers in function calls
    By vien_mti in forum C Programming
    Replies: 3
    Last Post: 04-24-2002, 10:00 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21