i need to include this function in another program, and he is writen in C, not C++
I already know where to put the code, but i dont know how to convert this code from C++ to C
.
Type: Posts; User: fbs777
i need to include this function in another program, and he is writen in C, not C++
I already know where to put the code, but i dont know how to convert this code from C++ to C
.
so anyone can convert this code to C?
the objective is read the /tmp/file1. if the content is 0 do nothing, if the content is 1, do something
I have this code in a C++ program for linux, but i dont know if this can be placed in a C program "as is" or need some modification.
#include <fstream> //used to ifstream, ofstream
#include...
the only code i know is in shell script:
go=`cat /tmp/file_test` # "cat /tmp/file_test" read the content of the file_test
if [ "$go" -eq "1" ]; then # if the content...
????
what i need is very simple to do in shell script:
go=`cat /tmp/file_test` # "cat /tmp/file_test" read the content of the file_test
if [ "$go" -eq "1" ]; then ...
i want to close the program if the content of the file /tmp/file_name is 1 (just the number 1).
dont need to check all the time, just when start the program.
can someone post a code to do this?
this:
something like this:
infinite loop{
num='cat ./num'
if num == 0
yes, but isnt a program just for this, this must be a function inside the normal program.
A function to monitor this file, looking for changes from 0->1 or 1->0, and react accordingly.
In the...
hi.
i have a file "temp" just to store a number
every time a x key is pressed, the number in file increase +1, and every time a y key is pressed, the number in file decrease -1, until 0 (0 is...
sorry, on the last edit to include the links i forgot to put all again... yes, is the sdlmame and use sdl.
i will see the source code of the xvkbd to see how he send the signal, and try to put in...
well, using the comand on terminal:
xvkbd -text c
he returns the letter "c" on terminal, but if i try this:
if ( ok() )
{
if ( event.jbutton.button == 7 )
well, im trying to edit the source code of an emulator, to accept a key only if ok() allow, but the emulator accept the keys and buttons everywhere, so dont matter the content of ok(), if i press the...
I want something like this in a program running on linux:
if ( ok() )
{
<code>
}
where <code> is a function to automatically press the key "C" in the keyboard, and the...
thank you, that was because the "<< endl" :)
I have this source and im trying to use it on linux:
#include <iostream>
#include <sstream>
#include <fstream>
using namespace std;
int main ()
{
char c;
when i execute in terminal the comand
ls /dev/disk/by-id/ |cut -d_ -f3 |head -n 1
i have this result with this hard disk:
S19GJ50Q342568
hi
im trying to make a program in linux to call another program doing first a check to see if the HD has the right serial number
i know if i put the serial in some parts of the code is possible...
i want to make a simple program to act like a daemon, running in background on system, just waiting the key "c" be pressed to activate for 5 min. some keys on keyboard (like a, b, d, f...).
After...