answersLogoWhite

0

If you are talking about procedural languages like C, then you have two options:

Declaring global variables. These can be declared in header files, which are #included in source files to gain access to the shared data variable. Another way is to define a variable in a source file, then declare it extern in the other source files that use this variable. Note that the use of global variables is risky and generally frowned-upon.

Passing variables as function arguments. Some languages make a distinction between passing by value vs by reference. In C, everything is passed by value, even the arrays you pass are passed by value (the passed value is a pointer to the zero-th element of the array).

There are other ways of course, like using shared external files (especially if the data is shared between different processes, or multiple instances of the same process), shared memory, and semaphores (which are collectively known as IPC - InterProcess Communication).

User Avatar

Sharad Jha

Lvl 2
3y ago

What else can I help you with?

Continue Learning about Engineering

The main emphasis of procedure-oriented is on algorithms rather than on data?

the main emphasis of procedure oriented programming is on algorithms rather than on data


What does object oriented and procedural mean in programming language?

procedure oriented means program will be execte in step by step procedure,when comes to object oriented means every thin can be represents the object a step[ step procedure doesnot follow


What is the difference between procedure-oriented and problem-oriented in C language?

C is neither procedure-oriented nor problem-oriented. C is a structured, general purpose programming language. Procedure-oriented programs are distinct in that code jumps around -- a lot. They do not have structured loops nor do they have procedure calls (subroutines, functions or procedures), but they do make prevalent use of jump or goto statements. As a result, procedure-oriented programs are often called "spaghetti code" due to the difficulty in both reading and maintaining the program. Machine code and assembly language are both examples of procedure-oriented languages. Although you could theoretically write a C program using nothing but procedural programming methods, the resultant spaghetti code will be extremely difficult to read and maintain. Imagine if you couldn't use for(), while() and do..while() loops, and couldn't call any functions, not even the built-in functions. You would basically have nothing more than a single main() function with all code contained therein. Even multiple statements enclosed in braces would not be permitted in procedural-programming. Problem-oriented programming languages are languages tailored to a particular application. Although it is possible to create a problem-oriented language within C, as a superset of C for instance, C itself is general purpose.


How you describe operations of stack ADT using c template functions?

No, because C does not support the concept of template functions. Template functions only exist in C++, never in C.


What is problem oriented language?

a program generation activity aims at automatic generation of a program.The source language is a specification language of an application doamain and the target language is typically a procedure oriented programming language.A program execution activity organized the execution of a program return in a programming language on a computer system.Its source language could be a procedure oriented language or a problem oriented language

Related Questions

What is the difference between structured oriented programming procedure and oriented programming?

LOTTA


How is it different from the procedure-oriented programming?

How is what different... Please restate the question.


The main emphasis of procedure-oriented is on algorithms rather than on data?

the main emphasis of procedure oriented programming is on algorithms rather than on data


What does object oriented and procedural mean in programming language?

procedure oriented means program will be execte in step by step procedure,when comes to object oriented means every thin can be represents the object a step[ step procedure doesnot follow


What is the difference between procedure-oriented and problem-oriented in C language?

C is neither procedure-oriented nor problem-oriented. C is a structured, general purpose programming language. Procedure-oriented programs are distinct in that code jumps around -- a lot. They do not have structured loops nor do they have procedure calls (subroutines, functions or procedures), but they do make prevalent use of jump or goto statements. As a result, procedure-oriented programs are often called "spaghetti code" due to the difficulty in both reading and maintaining the program. Machine code and assembly language are both examples of procedure-oriented languages. Although you could theoretically write a C program using nothing but procedural programming methods, the resultant spaghetti code will be extremely difficult to read and maintain. Imagine if you couldn't use for(), while() and do..while() loops, and couldn't call any functions, not even the built-in functions. You would basically have nothing more than a single main() function with all code contained therein. Even multiple statements enclosed in braces would not be permitted in procedural-programming. Problem-oriented programming languages are languages tailored to a particular application. Although it is possible to create a problem-oriented language within C, as a superset of C for instance, C itself is general purpose.


What do you mean by procedure oriented programming?

A list of instructions telling a computer, step by step, what to do.


What is the different between c and c plusplus?

C is a procedure oriented programming and C++ is a object oriented programming.C++ is a superset of C.


What is first procedure oriented language?

The first procedure-oriented programming language is considered to be Fortran (short for Formula Translation). It was developed by IBM in the 1950s for scientific and engineering computations.


What kind of language is C programming?

C is a general purpose, procedure oriented (procedural) programming language developed by Dennis Ritchie in 1972.


Advantages of procedure oriented programming?

The ability to reuse the same code at different places in the program with out coping it.


What does an object message correspond to in non-Object oriented programming terms?

A call to a procedure from your main routine.


How you describe operations of stack ADT using c template functions?

No, because C does not support the concept of template functions. Template functions only exist in C++, never in C.