Programming :: Real Life Example Of Running Main Function Infintely?
Jun 18, 2011This is not a Linux specific question.Can someone over here give me an example where I have to run the main function infinitely?
View 4 RepliesThis is not a Linux specific question.Can someone over here give me an example where I have to run the main function infinitely?
View 4 RepliesI have started learning C and am following Ivor Horton's "Beginning C - From Novice to Professional". I've noticed that in the book the structure of the main function is:
int main (void) however on the internet I found a lot of cases: void main (void)Which one is preferred and why?
I have a project in which many processes run. p1,p2,p3.
->There are some .so files are included in some process when needed example ppp.so in process p1 (when ppp is needed and will go like a plugin) but it has a init () function how a process includes a init() function ?
->process p1 has main function i.e main()
->so evry process has main() right ?
what is the difference between init () and main () functoins. where is init () used and how many init() a process van have ?
it possible to access main program function from dynamicallyinked library in c language?For example:main.c:
Code:
#include<stdio.h>
void func()
[code]...
I've having problems with my Makefile.
I'm trying to create a program from 2 files - main.cpp that contains the main function, and modules.c that contains the definitions of the functions that are called in main(). modules.c only contain function definitions, no main function.
My Makefile is as follows:
Code:
I have included "modules.h", which contains all the function declarations, in my main.cpp.
When I try to make using this Makefile, I get the error
Code:
If I switch the order of modules.o and main.o in my $(TARGET) line, then I get errors that say "undefined reference to" the functions I have defined in modules.c, in main.cpp.
What is the real difference between system calls and normal function calls. Ultimately function calls too would be passed to kernel for some or the other work.
View 7 Replies View Relatedtrying read serial COM port and want to write that received data to file, now its writing only one sentence, but i want to write full file which coming on serial port, as i'm sending file from hyper terminal and reading on linux pc, If i put while loop its not writing anything,without while loop its writing only one line and if send big file then application terminates and then writes to file.But i need do write any size which coming on serial port.Finally i want write full file which is coming on hyper terminal, after writing the file it has wait for next data. This is my code,
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
[code]...
I've decided to format my netbook entirely and just run NBR. I still need a windows install because a lot of stuff still doesn't work correctly in wine.
will running a virtual windows install kill mu netbooks battery life quickly or is it the same as running any other program? also what's a good virtual OS program? I think the only one I know of it vmware or something?
Code:
#include <iostream>
using namespace std;
[code]...
I am doing some Linux kernel programming for my research project. I need to record the timestamp (by using cpuid and rdtsc) when an interrupt handler (top half) is first invoked. Due to the time critical nature of the problem itself, I have to do the timestamping inside the interrupt handler itself (the first operation when the handler is called). However, I understand that tasks that are not so time critical should be deferred to a tasklet function (bottom half) for processing because other interrupts are disabled in a (top-half) interrupt handler. I am currently out of idea on how I can pass the timestamp information that I have obtained in the interrupt handler to the corresponding tasklet function.
View 2 Replies View RelatedIs the PID of a process changes during it�s life cycle in linux ?Or it�s PID is fixed throughout of process�s life cycle.
View 2 Replies View RelatedAs i went through some tutorials found no difference in their meaning .. explain the difference in usage.
View 5 Replies View RelatedHere's my specs:
AMD Semprom 1.8Ghz
512 MB RAM
Nvidia TNT2 M64 @ 32 MB
I know it's old lol but probably better than the onboard graphics. The computer is a Compaq Presario sr1403wm. I checked proprietary drivers and there are none available. The graphics run smooth on the desktop and I don't have Compiz enabled. is the graphics card just too old for XBMC? Weird thing is, I also have the same problem in Ubuntu on my good desktop when it's connected to my TV. Just using a normal VGA cable. If I have it connected to my computer monitor using a DVI cable, there's no problem. The only thing I thought of was maybe the resolution was too high, but that made no difference with either computer. If this computer is too old for XBMC, what would be second best in line? MythTV? Doesn't need TV capabilities. Just to watch what's already on the computer. I just really like the XBMC interface and the fact that I can boot right into the interface and of course all the cool plugins and whatnot.
I have the latest release of Lucid Lynx installed. I want to try out audio recording on Linux so I want to know if it's possible to use a real time kernel with Lucid. So I installed the 2.6.31 real time kernel. It shows up in GRUB, but when I boot it gives me the message:
mounting none on /dev failed No such device
It then takes me to the login screen, and once I enter my password it just takes me back to the login.
I want to declare a function in a function, but had no success till now, see the error code below and visit the project at sourceforge
[Code]...
I looked on the net for such function or example and didin't find anything, thus after having made one i guess it would be legitimate to drop it to see what others thinks of it.
#!/bin/bash
addelementtoarray()
{
local arrayname=$1
[code]....
I wish to make a clone of my main hd running Suse Linux 10.1. I'd like the clone to act just as the original i.e. booting the system with 1 other hd and an cd drive. I think I hear the bearings on my 200 gb maxstor. I have a 300 gb maxstor that I wish to use as hda.
View 10 Replies View RelatedI want to start real time programming for linux(RTOS) so where I can get the basic of programming.I want to do it in C language..
View 2 Replies View RelatedI seed a suggesting related asychron io. I'm write a program which use completion ports, but wandor how avoiding loops like for(; below...i.e I want parse proto with count in first and then computing some quantity of pieces. how that make with aio?
Code:
fit a surface i.e. W(x,y) using svdfit() provided by "Numerical Recipes in C". svdfit() is written for curve fitting and not for surface fitting.But one can use svdfit(), as claimed by authors of NR book, to do surface fitting. On page 680 of NR book, authors have given a hint on how to use svdfit() for fitting a surface. But I have not understood it.This link may be helpful (Chapter 15 th is relevant here.):[URL]This is my problem:
Code:
I have a set of 100 numbers. I want to fit a 2-Dimensional function W(x,y) to these numbers.
[code]....
I have problems,I get this:
milenko@hp6830s:~/mt2ddi$ make mt2ddi
f77 -o -m64 driver.o solve_mt2d_direct.o boem.o rotz.o gebolr.o d2emod.o pobo.o mte.o d2hmod.o gsres.o mth.o z1idu.o h1iud.o phase.o
[code]....
When I fork multiple processes, is there some command or c function to see the cpu number on which the processes are running?
View 3 Replies View RelatedI just need to perform a simple operation of subtracting two numbers - that aren't whole numbers, i.e 200.56 - 67.24attempting to use expr i merely get "expr: non-numeric argument"
View 3 Replies View RelatedI use tomcat as my server platform in Ubuntu for a war file. I know in order to get real time information about how many user are logged in, we can count how many active sessions exist by a SessionCounter code. However, I have to permit HttpSessionListener in web.xml of tomcat. From other users' experiences, the configuration is complexed and has some errors.
Here's the link:
[URL]
In order to get users'ip, in jsp, use request.getremotehost() or request.getremoteaddress() by editing the jsp file. I wonder if there's some open source software to use for these two purposes.
I am trying to write suitable .pro file for my application. I need real-time library. Have you some ideas how to do that? I just need the line for linking with real-time library...
View 2 Replies View RelatedAn application that can make sound equalization but I couldn't find any powerful tool so I decided to do one my self I know it will be very hard task but their is no other solution my program will do some audio effects like (echo, repeat, trible, bass, filtering, fading,...)and (fft,addition,....), I will take the signal from the mic and put it on the speaker after my operation is done I think I must take into consideration that application is a real time but i don't know what to do! i don't know should I use java or C/C++! I don't know how to deal with the audio driver (take signal from mic and put it on the speaker)
View 10 Replies View Relatedhow do i configure a designated monitor to be my main desktop when running dual monitors in separate x windows?i cant use twin view, as full screen issues and refresh rates are different.
View 1 Replies View RelatedHow to change the complex number like -123.45e67 in to real number.
with command of awk print
i am using putty to connect to the linux server and i am using nano as my text editor to write a bash script.
this is my script:
echo "Please enter your Username"
read userName
userName= grep $USER /etc/passwd | cut -d: -f5
echo "Welcome " $userName | cat >> output.txt
the problem i have is that when i enter my username, the output (my real name) does not display in the output.txt. instead it displays in putty. so when i run my script in putty it shows the message to enter username and after i enter my username my real name appears below it. i want it to show in the output.txt
When I try to compile my code using g95 or gfortran:
Code:
subroutine dipole_tilt(glong, glat, utsec, tau, day, hgraze)
implicit none
[code]....