Thread: Help with making a Math Expression DLL

  1. #16
    Officially An Architect brewbuck's Avatar
    Join Date
    Mar 2007
    Location
    Portland, OR
    Posts
    7,396
    Quote Originally Posted by MindWorX View Post
    Don't know, that's what i've always done. But seems to work now. How will this affect my project if the rest of it is named cpp, and this file is going to be a .h file in the end? Should all my files be c then? Or should i do the linked list in c++ instead?
    The compiler doesn't try to determine language from a .h file. The code in the .h file will be compiled as the language of the .c or .cpp file which includes it.

    If the code is C, name the file .c, not .cpp. As you discovered, a lot of valid C code is not valid C++ code.

  2. #17
    Registered User
    Join Date
    Nov 2006
    Location
    82.192.160.50
    Posts
    17
    Quote Originally Posted by brewbuck View Post
    The compiler doesn't try to determine language from a .h file. The code in the .h file will be compiled as the language of the .c or .cpp file which includes it.

    If the code is C, name the file .c, not .cpp. As you discovered, a lot of valid C code is not valid C++ code.
    Yea i see. So, making the linked list with the c++ tutorial should be better i guess.

  3. #18
    Algorithm Dissector iMalc's Avatar
    Join Date
    Dec 2005
    Location
    New Zealand
    Posts
    6,318
    Quote Originally Posted by QuestionC View Post
    This could actually be useful for implementing a routine to perform bulk math operations...

    Code:
       // :1 is a placeholder for the variable
       math_transform("5 + 3 x :1 + 7", input, output, num_elements);
    You misunderstood me.
    I was in no way implying that such an endeavour was pointless. I was merely wondering if the point was to learn about DLLs, or learn about syntax trees, or to learn something else, or as part of another project (that perhaps needn't be split into another DLL), or as a plugin to something else etc...

    When someone asks a question the first step is to establish if they are asking the right question, and only after that, actually answer it.
    My homepage
    Advice: Take only as directed - If symptoms persist, please see your debugger

    Linus Torvalds: "But it clearly is the only right way. The fact that everybody else does it some other way only means that they are wrong"

  4. #19
    Officially An Architect brewbuck's Avatar
    Join Date
    Mar 2007
    Location
    Portland, OR
    Posts
    7,396
    Reinventing the wheel?

    One word (two?):

    boost::lambda

  5. #20
    Registered Abuser
    Join Date
    Jun 2006
    Location
    Toronto
    Posts
    591
    I recently needed to make a syntax tree; I found the Trie particularly useful and interesting to implement.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Please Help - Problem with Compilers
    By toonlover in forum C++ Programming
    Replies: 5
    Last Post: 07-23-2005, 10:03 AM
  2. Expression Evaluator Contest
    By Stack Overflow in forum Contests Board
    Replies: 20
    Last Post: 03-29-2005, 10:34 AM
  3. .lib vs .h vs .dll
    By Shadow12345 in forum C++ Programming
    Replies: 13
    Last Post: 01-01-2003, 05:29 AM
  4. Passing parameters from VB to C++ through ActiveX DLL
    By torbjorn in forum Windows Programming
    Replies: 0
    Last Post: 12-10-2002, 03:13 AM
  5. Help! Program to evaluate expression...
    By Unregistered in forum C++ Programming
    Replies: 7
    Last Post: 02-19-2002, 06:20 AM