This question relates to programming for Linux. I understand that all programs which run under a bash terminal will exit when the terminal closes, unless they are run in the background by app...
1) What is the C function to obtain a process id of say smbd and nmbd or any other process using the name of that process?
2) What is the C function to stop a process ID?
3) I do not wan...
Hello,
I am having an issue with a function I have written accepting input as a string and converting it to a float usint atof(). When it is run it accepts the string beutifully but does f...
I am writing a little program to learn about socket programming. So far, it listens on a specific port, and I am able to telnet in and send a message. It then recieves the message and displa...
HOW TO FIND THE LENGTH OF A STRING WITHOUT USING STRLEN METHOD
the task is:
a) using the BIOS 14h serial port services, write a program in C (inline ASM when necessary) to read a char from the
keyboard,send it to the COM2 port,recieve back from COM...
I know the rules state that I'm not allowed to let you answer this question for me, since it's for school. But directing me in the right way would be more than helpful.
Basically I have a ...
Is it possible to do a condition compile in unix/linux using a makefile. I wrote a server and a client and need to compile the server selectively based on which OS the makefile is run.
i...
Hi, I have an assignment to make a program which list files and directories in the current directory (a simple version of ls). I can not finure out how to convert structures in the stat type ...
i'm trying to make a little software in linux, which ask for password.
i want that each single character that pressed to output '*'.
We have a code as below:
#include<stdio.h>
#include<unistd.h>
#include<string.h>
main()
{
char *i;
const char ch = 'a';
strcpy(i,&ch);
printf("%lx %lx %c",sbrk(0),i , *i);
}
...
Hi,
I did a small code so that return type is of pointer..but I am getting error: return makes pointer from integer without a cast .
int *add(int *,int*);
int main()
{
int *a=10, *b=...
void T4Unicode::getUnicodeId(char *out, const char *value)
{
unsigned short ucs2[UNICODE_BUFFER];
utf2ucs (ucs2, UNICODE_BUFFER, value); //this function will fill ucs2 array with hex valu...
some time ago i found a really nice snippet that showed how to write a log message into the windows event viewer. sadly i can't remember where i saved that snippet.
anyway is there a way to...
Hi all,
How can i convert a double number to an array of char, or a pointer to char??
Ex:
double d = 593.90;
char mesg[255]; // or char * mesg;
how the variable mesg can obtain "5...
I'm having problems getting the Win32 CriticalSection calls to work. In the following code, the call to EnterCriticalSection seems to be ignored, and each call to SearchFunc gets the value 'z'...
Hello,
Could you please show me how to copy a LPTSTR and char * to a char array.
LPTSTR pName
char szName[100]
and
char *pName
char szName[100]
Thank you for your time.
i want to know that how we can find out a name of an directory or folder name by c or c++.
we can search a file name by using "findfrist()" funtion.
it search current directory for files but...
I am trying to link a c progam in x64 using VS2005. This is the error I get. Any suggestions?
Error 1 error LNK2019: unresolved external symbol main referenced in function __tmainCRTStar...
some of the data structures like array, linked list, stack etc. are linear whereas others like tree, graph etc are non-linear.
but what is meant by linear and non-linear data structures ?
h...
Hi I am getting error in the following line....
int m=0;
for(l=0; txt[l] != '\0'; l++)
{
if((txt[l] != ' ') && (txt[l] != '\r') (txt[l] != '\n'))
{
str[m]=txt[l];
m++;
}...
after breaking my head trying to make EjectDiskFromSADrive() work i finally decided to ask here.
i need to "safely remove" or eject USB devices from a computer by code. the operating system i...
I have this code in C: How do I code a part to find the string "Sending boot event" that is contained in the BlackHostLog.txt and report a message saying passed to the status file?
#includ...
I have the program which talks with some hardware device using parallel port. To talk with device I use the following driver:
http://www.driverlinx.com/DownLoad/DlPortIO.htm
This is simple N...
#include <semaphore.h>
#include <unistd.h>
static sem_t count_sem;
int main(int argc, char* argv[]){
sem_init(&count_sem,1,3);
while(1){
sem_wait(&count_sem);
fork();
if(getpid()=...