answersLogoWhite

0

Subroutine:

1.When a task is to be done repeatedly then it is written as subroutine and this subroutine will be called each time to perform that task.

2.Subroutine program will be stored in some memory location and program control will be transfered to that location each time.

3.where as in macro the number of instructions will be less than subroutine.Here each time u call a macro that set of instructions will be inserted in that location.

4.macro doesn't have return statement while subroutine has.

5.memory requirement for macro is higher.

6.execution time of macro is lesser than subroutine.

User Avatar

Wiki User

10y ago

What else can I help you with?

Continue Learning about Engineering

What is the difference between macro and inline function in c plus plus?

Macros are not actually part of the C++ language; they are nothing more than a simple text-replacement system intended to simplify your coding. Macros do not adhere to C++ type safety and cannot be debugged because macros are preprocessed, prior to compilation. Your compiler can only see the preprocessed code, not the original source code, and therefore cannot debug macros because the macros no longer exist at that point. Inline functions are functions that can be debugged like any other function, but the compiler is able to eliminate the overhead of function calla by replacing those calls with inline expanded code. This is not unlike a macro, which is by definition inline expanded, but retains the built-in type safety and debugging capabilities of the C++ language itself. Typically, if you can use an inline function (or C++ is general) then that is always the preferred option. But if a macro can achieve more than can be achieved with C++ alone, or can otherwise simplify the equivalent C++ code, then use a macro. Just keep in mind that macros are not type-safe and cannot be debugged by the C++ compiler.


What are macros in spreedsheet?

Macros in spreadsheets are automated sequences of instructions that help users perform repetitive tasks efficiently. They are typically created using a programming language, like VBA in Excel, and can be triggered by user actions, such as clicking a button or opening a file. By recording or writing macros, users can save time and reduce errors in data manipulation and analysis. Overall, macros enhance productivity by streamlining complex processes.


Elements of assembly language programming What is A simple assembly scheme pass structure of assembler design of two pass assemblers a single pass assemblers what is macros?

what are the elements of assembly language programming?


Most c plus plus programmers use uppercase letters for variable names true or false?

False. Most C++ programmers use uppercase for macros (precompiler definitions), making them less likely to be confused with actual variables, constants or functions in the C++ source code. Macros are not actually part of the C++ language because the compiler never sees them, but they allow the precompiler to perform preprocessing tasks that would be difficult or impossible to accomplish with C++ code alone.


Assembly language to machine language translation is?

Assembly language to machine code translation is a "one to one" translation process, as every individual instruction expressed in the assembly language corresponds to exactly one machine instruction. Note this does not hold for pseudo instructions or expanding macros, which are supported by some assemblers.

Related Questions

Which is preferred to use in a program Macros or functions?

Definitely functions, since they provide type safety. Many macros also generate unwanted behavior, because of the way they're expanded. In my opinion, just use inline functions, but if it seems appropriate to use macros, use them -- but do so, with caution.


What types of macros are available in Flowcode?

Component Macros are built in functions used to control components such as an LCD display, EEPROM, switches, serial data, etc. Macros are user created functions that help make the program more modular. As far as I can tell, there are only those 2 types.


Which header files contain declaration for the files input and output functions and the macros defined and that are used with file input and output functions?

stdio.h


How marketing functions can be shifted and shared?

Marketing functions for macros cannot be shifted or shared. They must all be processed by someone and none can be left out.


What are the icons in Microsoft Word 2007 and their functions?

Word 2007 file extensions have been changed as noted below :Type FileWord 2007 document without macros .docxWord 2007 document with macros .docmWord 2007 Template without macros .dotxWord 2007 Template with macros .dotm


What is the difference between macros in Microsoft Word and Microsoft Excel?

Not much, except that the macros would be written to perform different tasks, because Word (word processor) and Excel (spreadsheet) have different functions. Both are written by the user to perform a specific task, but since each application handles most tasks differently, the macros would need to be designed for the tasks relevant to the specific application.


What is the difference between macros and wizard?

a wizard inserts fields and a macros is something like a hyperlink that when you click on it, it automatically takes you to another page!


Can you leave blank lines between macros in a macro group?

No, because Access will interpret a blank line as no further action and stop executing the macros.


Will openoffice crash with macros?

The honest answer is: "OpenOffice.org is software and therefore can crash as any software." However, the more interesting question is does OpenOffice.org support macros? The answer is: Yes and No! OpenOffice.org does support its own macro language. However the standard edition (as of release 2.3) does not support Visual Basic Macros, as used in Microsoft Office. There are editions of OpenOffice, that support VBA macros.


Why you use ctype.h in c language?

it contains the information used by character classification and character conversion macros


What are the complex technical functions offered by the word processing package?

form fields, linking, macros, table of contents, styles


What is the difference between macro and inline function in c plus plus?

Macros are not actually part of the C++ language; they are nothing more than a simple text-replacement system intended to simplify your coding. Macros do not adhere to C++ type safety and cannot be debugged because macros are preprocessed, prior to compilation. Your compiler can only see the preprocessed code, not the original source code, and therefore cannot debug macros because the macros no longer exist at that point. Inline functions are functions that can be debugged like any other function, but the compiler is able to eliminate the overhead of function calla by replacing those calls with inline expanded code. This is not unlike a macro, which is by definition inline expanded, but retains the built-in type safety and debugging capabilities of the C++ language itself. Typically, if you can use an inline function (or C++ is general) then that is always the preferred option. But if a macro can achieve more than can be achieved with C++ alone, or can otherwise simplify the equivalent C++ code, then use a macro. Just keep in mind that macros are not type-safe and cannot be debugged by the C++ compiler.