Hi all,
My requirement is to connect with the server if it is up ,the client will keep on trying to connect with the server till the successful connection.So I have created the socket fd using the...
Type: Posts; User: karthigayan
Hi all,
My requirement is to connect with the server if it is up ,the client will keep on trying to connect with the server till the successful connection.So I have created the socket fd using the...
Thanks for your reply . The command is a start up of an application.It self it gets backgrounding and it is not taking too much time to execute.the thing which I want is to execute the command and...
Hi all,
In my code i am using system() function to execute the command which puts the job in background.the system() function executes the command and also it gets executed successfully .But...
Use switch ,
#include<stdio.h>
main()
{
int op;
Here is the example for using system(),
#include<stdio.h>
main()
{
system("test.exe 5434 localhost");
}
Actually you have to print the address , is it .If you want the print the address of the variables you have to use '&' since you are trying to get the variables address.If you give the pointer there...
Every thing is ok.other than the '%n' in the scanf .You have to use '%d' is it .
# include<stdio.h>
int funct1(int n);
int main()
{
I tried your code in my linux machine . there is no problem ,the expected output came correctly .
#include<stdio.h>
main(int argc,char argv[]){
int i=0;
int arr1[40]={0};...
Like this we can return the array ,
#include<stdio.h>
#include<stdlib.h>
char* teste(char* s)
{
char *tok = (char *)malloc(3);
Just change these lines ,
if(sort_m = 1){
to
if(sort_m == 1){ // Use == for comparison
and
The problem is that the *ptr has no values when you assign that to b.So it assigns the garbage value in the *ptr to b.After assigning that only you have get the value of a .Now that a's value will in...
The Editors are just used to type your code . You can not run it straightaway,because it can not understand by the computer . You need to compile it to remove the errors and make that as a object...
It took me 6 months to finish K&R. It is a bible of C programming .
If you want to append character to a char * you need to allocate memory for that .
#include<stdio.h>
#include<string.h>
#include<malloc.h>
main()
{
char *a="Hello ";
Try this , you will get to know the problem.
#include<stdio.h>
#include<string.h>
main()
{
int arr[10];
char arr2[10]="abcdefghi"; // Initialize the array
What is the input you gave for the option . Otherwise post the output you got.
When you print the results you used %d .But the values are floating point values . So use %f.
#include <stdio.h>
#include <stdlib.h>
int main ()
{
Infact I commented the statement
system("Pause");
Just remove the comment in that statement .
The problem is the that you have checked the storelocation values as a character .But it is a integer .
#include <stdio.h>
#include <stdlib.h>
int main ()
{
Hi all,
I want to do graphics applications in C under linux system.Can any one guide me to some good tutorials.
Answer for your first question :
If you want to read a line from the file you have to use the function fgets.It will read the entire line . I thing you used fscanf there .It will read...
Use this code,
#include<stdio.h>
#include <string.h>
#include<stdlib.h>
char *replace(char *str, char *from, char *to);
main()
The exact problem is in this line ,
serverAddr.sin_addr.s_addr = htonl(inet_addr(ip));
It should be,
If you are working in linux machine you can get the online file using the command wget.
wget www.example.com/golf.txt
It will store in a particular file in the...
option (d) is correct .
The C Book — Linkage