Visualizzazione dei risultati da 1 a 3 su 3
  1. #1
    Utente di HTML.it
    Registrato dal
    May 2008
    Messaggi
    475

    [C/C++] Dubbio veloce sulle macro

    Ciao a tutti...

    Premetto che non sono proprio sicuro di aver capito alla perfezione le macro del preprocessore. Se non sbaglio, il concetto è che il preprocessore sostituisce alla macro il codice (o il valore) all'interno del resto del codice sorgente e poi lo compila.

    ... ma allora che differenza c'è con le funzioni inline? :master:
    "Let him who has understanding reckon the number of the beast, for it is a human number.
    Its number is rw-rw-rw-."

  2. #2
    Utente di HTML.it L'avatar di shodan
    Registrato dal
    Jun 2001
    Messaggi
    2,381
    Con una funzione inline hai il controllo sui tipi usati, con una macro no.
    In più le funzioni inline sono soggette ai namespace, le macro no.
    This code and information is provided "as is" without warranty of any kind, either expressed
    or implied, including but not limited to the implied warranties of merchantability and/or
    fitness for a particular purpose.

  3. #3
    Utente di HTML.it
    Registrato dal
    May 2008
    Messaggi
    475
    Ok capito. Le funzioni inline sono vere funzioni, le macro sono solo dei pezzi di codice che vengono copiati dal preprocessore.

    Grazie mille.
    "Let him who has understanding reckon the number of the beast, for it is a human number.
    Its number is rw-rw-rw-."

Permessi di invio

  • Non puoi inserire discussioni
  • Non puoi inserire repliche
  • Non puoi inserire allegati
  • Non puoi modificare i tuoi messaggi
  •  
Powered by vBulletin® Version 4.2.1
Copyright © 2026 vBulletin Solutions, Inc. All rights reserved.