473,698 Members | 2,343 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

does #pragma startup work in c?

5 New Member
Expand|Select|Wrap|Line Numbers
  1. void first();
  2. void last();
  3.  
  4. #pragma startup first
  5. #pragma exit last
  6.  
  7. #include<stdio.h>
  8.  
  9. main()
  10. {
  11. printf("I m in main");
  12. }
  13.  
  14. void first()
  15. {
  16. printf("I m in first");
  17. }
  18.  
  19. void last()
  20. {.
  21. printf("i m in last");
  22. }
  23.  
When i m running this program i did not get the desired result this only prints

i m in main does #pragma work in c?

I have compiled this code using both turbo c and visual studio compilers
Jul 17 '08 #1
3 4540
JosAH
11,448 Recognized Expert MVP
Pragmas are not just compiler vendor specific, they're also version specific; when
a compiler implementation doesn't implement a certain pragma it is supposed to
ignore it. Read your compiler's user manual.

kind regards,

Jos
Jul 17 '08 #2
chandru
5 New Member
Thanks for ur reply. could u tell me about the turboc compiler version which one has the #pragma startup directive ?

Thanks in advance
Jul 17 '08 #3
JosAH
11,448 Recognized Expert MVP
Thanks for ur reply. could u tell me about the turboc compiler version which one has the #pragma startup directive ?

Thanks in advance
I don't know; I don't use any TurboC compiler but I think what you want to
accomplish can also be accomplished by:

Expand|Select|Wrap|Line Numbers
  1. int main() {
  2.    first();
  3.    ...
  4.    last();
  5.    return 0;
  6. }
  7.  
kind regards,

Jos
Jul 17 '08 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

2
14165
by: Mike | last post by:
I am sure that I am making a simple boneheaded mistake and I would appreciate your help in spotting in. I have just installed apache_2.0.53-win32-x86-no_ssl.exe php-5.0.3-Win32.zip Smarty-2.6.7.tar.gz on a system running WindowsXP SP2. Apache and PHP tested out fine. After adding Smarty, I ran the following http://localhost/testphp.php
1
5523
by: JustSomeGuy | last post by:
I need to define a structure that is byte packed. I was planning on using #pragma pack (1) So when does the pragma pack end right after the first structure definition or at the end of the header file or until a new pragma pack is encountered... This need to work for visual c++ as well as g++ (gnu cpp 3.3)
12
5738
by: rdemyan via AccessMonster.com | last post by:
I'm having a complicated linking problem. Before I get into the particulars, I'd like to know how Access links to the back-end file at startup, AFTER I've distributed my application to the client. Here's the issue. While I'm working on my app, I'm linked to the backend on my computer. When I distribute the app, the backend file is obviously in a different location (on the client server). But the first time my app is started up at...
13
520
by: Protoman | last post by:
I'm getting an error: 10 C:\Dev-Cpp\Enigma.cpp no match for 'operator<' in 'i < (+cleartext)->std::basic_string<_CharT, _Traits, _Alloc>::end ()' Code: Enigma.hpp -------------------------- #pragma once
3
4760
by: Jimmy | last post by:
Struct definition as following(on 32-bit Linux): #pragma pack(push, 8) struct MY_STRUCT { char a; short b; short c; short d; int e;
26
3814
by: Rick | last post by:
I'm told that "#pragma once" has made it into the ISO standard for either C or C++. I can't find any reference to that anywhere. If it's true, do any of you have a reference I can use? Thanks...
0
10687
debasisdas
by: debasisdas | last post by:
PRAGMA:-Signifies that the statement is a pragma (compiler directive). Pragmas are processed at compile time, not at run time. They pass information to the compiler. A pragma is an instruction to the Oracle compiler that tells it to do something. In this case you are telling Oracle to associate an error that you choose to a variable that you choose. This pragma must go in the declarative section of your block. Types of PRAGMA...
2
6663
by: medrifter | last post by:
I have a program like this 1.Analyze.h as follows #if !defined(AFX_ANALYZE_H__550791A7_B441_4AD3_BCEB_4F391A71D410__INCLUDED_) #define AFX_ANALYZE_H__550791A7_B441_4AD3_BCEB_4F391A71D410__INCLUDED_ #if _MSC_VER > 1000 #pragma once #include <direct.h> #include "symbol_macros.h" #include "ShareTools.h"
4
2368
by: dissectcode | last post by:
Hello - Is there a pragma directive that will make a function be ignored? I have a function that is not currently being used and it creates a warning. I would like to fix the warning by using pragma, if possible but all I have tried isn't working... for example i tried: #pragma function(myFunct) //didn't work If pragma won't work - what is the best trick to have the compiler "ignore" a function that's not being used? thanks!
0
8674
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
8604
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
9028
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8895
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,...
1
6518
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
5860
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();...
0
4369
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4619
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3046
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

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.