473,795 Members | 2,861 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

functions and main

The following progs differ only in the location of the prototype
(<--adjective) definition with respect to the main call. Both build and
behave for me. Is there a difference that amounts to something once the
subject matters gets stickier? MPJ
#include <stdio.h>
int main(void){
int i = 5;
void increment(int *);
increment(&i);
printf("i = %d\n",i);
return 0;
}
void increment(int *px){
int tmp = *px;
++ tmp;
*px = tmp;
}
#include <stdio.h>
void increment(int *);
int main(void){
int i = 5;
increment(&i);
printf("i = %d\n",i);
return 0;
}
void increment(int *px){
int tmp = *px;
++ tmp;
*px = tmp;
}
Nov 14 '05
10 1532

"Prash" <pr****@rediffm ail.com> wrote in message
news:11******** **************@ c13g2000cwb.goo glegroups.com.. .
For a comprihensive definition of Foo have a look at RFC3092.
http://www.faqs.org/rfcs/rfc3092.html

Hilarious and enlightening. I must object to the contention that the
etymology of foobar entsteht aus 'furchtbar.' So laeuft det nich. MPJ
Nov 14 '05 #11

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
2354
by: [RaZoR] | last post by:
hello, main script creates IE window, put an array there and then calls a child script. chils script makes an array element equal to some object and returns control to main script. then main script doesn't see that object and its functions. why? here is the code I implemented: //in main script
7
1811
by: verbatime | last post by:
Please explain me how this works - or should work: Got my two classes - bcBasic (baseclass) and the derived cBasic. //--------------------------------------- class bcBasic { int number; virtual long myfunc(void); }
12
2093
by: Anthony Jones | last post by:
Just a bit of background: I'm one of a group of FORTRAN programmers, looking to switch to C++. We are trying to write a few simple examples to demonstrate the power of the language to our manager, so he will send us all on a conversion course. One of many reasons is that our code is littered with examples of: SUBROUTINE PRINT_ITEM(ITEM, ITEM_TYPE) IF (ITEM_TYPE .EQ. SQUARE) THEN CALL PRINT_SQUARE(ITEM)
25
5423
by: Stijn Oude Brunink | last post by:
Hello, I have the following trade off to make: A base class with 2 virtual functions would be realy helpfull for the problem I'm working on. Still though the functions that my program will use a lot are the ones that are virtual and thus will slow down the calculation, at least that is what what I have read on several places on the internet. It makes sense the program has to work with some kind off lookup table for the virtual...
1
380
by: PTS | last post by:
I am working on a program that will calculate some numbers. As an example, I will say student average test score and print out the grade but my question is how do I put AVERAGE and test score and the other parts, call the functions and where? How would I structure that program? Would I declare each function before the MAIN() function, then call them in the main. The program will read in a file and generate an output file. How do I...
4
1996
by: Ganesh Kundapur | last post by:
Hi all, suppose i have 100 functions such as f1, f2,...f100 in a single file including main. If i pass arguement to main such as $a.out f1 main should call appropriate functions. I can do this using switch statement, but if i have 1000 functions, then i have to write 1000 cases OR i can use pointer to functions. I am passing string to main, how to map this string to function efficiently.
1
11533
by: Jeff | last post by:
Hello everybody, I have a question concerning function declarations. When exactly do you have to declare functions if you want to use them? I have two functions main() and foo(), respectively defined in main.c and foo.c. There is no declaration of foo() inside main.c, but main() calls foo(). If I compile both files (using gcc's -c option), and then link them, main() calls foo() without any problem. How come ? Wasn't I suppose to declare...
7
1195
by: Bmack500 | last post by:
I'm using visual studio 2003. I have much of my code in my main form, called 'frmMain'. When I create a class to perform string ops and such, it sometimes needs to refer to functions in the main form. However, when I use "inherits frmMain" in the class, as soon as I try to build/run the program it gives me a System.stack overflow error. No other indication of what's wrong.
21
2556
by: asif929 | last post by:
I need immediate help in writing a function program. I have to write a program in functions and use array to store them. I am not familiar with functions and i tried to create it but i fails to run, However, i simply created this program in arrays and it runs good except i cant figure out how to compute the standard deviation. The coding is below. Any help will be appreciated. 1) The Program will prompt the user for six grades to be...
4
3814
by: ahagley | last post by:
The problem: 1) I'm not a programmer, most of the time I'm a physicist, but I do numerical simulation. 2) I have a DLL that I want to use functions from. I have the .h file associated with the DLL, but no .def or library that I can use for static linking. I am trying to implement the GMP (GNU multiprecision library) in a large simulation code that I’ve been running on a PC, written in standard C. I’ve been using MetroWerks CodeWarrior...
0
9673
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9522
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10443
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10165
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9044
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7543
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6783
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
4113
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2921
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.