15,552 Topics
| |
Hi all, I am a newbie to C programming world. In my program I want to log information into a log file whose file name should be filename_date_time I am using following code to write information but need help in changing the file name from filename to filename_date_time. [CODE] #include … | |
[code=c] // a code which prints "hello world" #include<stdio.h> int main() { (&printf)("hello world"); return 0; } why does the above code work? #include<stdio.h> int main() { char str1[]="hello"; int j=762; char str2[]="hello"; if(str1==str2) printf("true %d\n",--j); else printf("\nfalse %d\n",j--); return 0; } [/code] //the above code prints "false 762", why? … | |
i can't remember exact formula of the pascal triangle if you know then please send me the formula and the pascal triangle code in c i think y=c*(y-x)/(x+1); this is wrong but you can modify and send me | |
Hello all. I have a problem with a socket server program I writing. The server manages to set up the socket just fine, however, it now needs to be able to take in input from a client. I using the following command to receive information and print it out on … | |
I'm modifying a 10-year old open-source utility written in C, even though I'm a PHP programmer, so the whole pointer business for working with strings is giving me a headache. Can anyone advise on why this string conversion snippet is not converting case? [code=C] #include <ctype.h> int set_keysig (s, ks, … | |
I would very much appreciate if anyone could throw some light on this error, not too hot with "C" as yet. When I try and compile the following with Keil C51, I get the following error message. Error C208 DS1302GetAll Too many actual parameters Seems to be line in Time() … | |
im new to this forum and new to C++. i had a homework problem about arrays. the user inputs a number and i had to store it in an array. up to now i still don't know how to do it. and then after that i had to find max … | |
Stupid question. Haven't done production C in a while and just inherited some legacy code. In case it makes a difference it is running out of OMVS on a Z/OS IBM mainframe. The C program is invoked by an assembler program. The assembler program passes in a number arguments that … | |
Hi all, I have defined a new librray and want to simple include it in my program. I use #include</my path/library.h> and it works very well. but each time that I want to run my program in a new machine I have to change "mypath" manually. is a way that … | |
I'm writing a program for college and one part of it is to find the mean of a group of numbers that are inputted. The problem is that whenever I run the program the calculation always comes up with the same answer 2.39622e-43 I can't figure out why. Help please | |
Hi, I need a way to do this: One server thread has to read a message from a client thread. The client will send the message to a queue and the server thread will read from this queue. The message being sent will contain: (3 different things) 1-ID of Client … | |
Dear Daniweb, I am currently doing a commandline for a rabbit module. Using Dynamic C. Do you know how to code to recognise user's key strokes? Like if user press UP, it will display the previous command typed. If user press DOWN button, displays next command typed.. Thanks! Some articles, … | |
Hello, all! I'm trying to understand how a client/server would work, and I found a server example I could play with on the internet. However, I can't get it to compile due to a bunch of undefined variables (sendto, socket, etc). Are there some options I should include in the … | |
Hi y'all! I need to sort an input of integers, long as we wish (not defined, depending on the user), which ends up by -1, and print it to the screen sorted. I can't think of anything that is simple enough to use (a beginners level, all we learned in … | |
I have a scenario like the client has to search for the active server.There will be many servers.But not all server are active.And at a time not more than one server will be active. The client will be in active state always i.e, it should always search for an active … | |
I'm trying to write a short code that will take in a string of text, and tell me how many vowels are in it, with the information being passed between a parent and child process using pipes (I am only testing for "a" at the moment until I get that … | |
I have a scenario in which there are many servers .But all these servers are not active always and not more than one server will come to active state at a time..Whenever any of the server comes to active state ,it has to send a "active state " acknowledgment to … | |
Hi guys, I need some help with a project...apart of it requires me to add, delete, edit and view records from a file, I have gotten the add to work so far but it will not delete records from the file, I am wondering if it has to do with … | |
hello all, I have to write the code to read the file line by line and sort its words in alphabetical order n store into another file, i have done with the feathing the line from one file but strugling with the sorting part can anybody suggest how should i … | |
i have one serial file n1\n2\n2\n4\n5\n6\........n want to read last file only in above file....can any one tell me how come/ | |
Help Please!! I made a struct array, and I'm trying to pass the entire array of that object to another function. [code=c] struct Crypt { char english; char code; int count=0; }; void main (void) { Crypt Key[26]; analyze(key); } void analyze(?????????) { int i=0; /*just a sample of the … | |
Hi all; i have some problem with my code.. I want to read txt file which include : rectangle 0 0 1 1 orange rectangle 0 1 1 1 green rectangle 0 2 1 1 white rectangle 0 3 1 1 orange rectangle 0 4 1 1 white rectangle 0 … | |
My exposure to arrays and pointers are bit limited. And concatened strings even less ( it was not covered in my class so I had to google it. ) So I know there are errors. I can not use any of C string libary functions. Thoughts? [code=c] #include <stdio.h> char … | |
1. [code] #include<stdio.h> int main() { int function(int); int t=function(1); printf("\tt=%d",t); t=function(2); printf("\tt=%d",t); t=function(3); printf("\tt=%d",t); return 0; } int function (int a) { int t; t = a<<2 + a; return t; } [/code] the output is t=8 t=32 t=96 i am not able to figure out why this is … | |
I wrote a program which will send a message to multiple clients(i.e, broadcasting) that are connected to a server.Once when the client receives a message from the server ,the client should read a file in the server and display it in the client.The client which responds (i.e, client wants all … | |
Write a program that reads in an array of type int. Provide facility to either read this array from the key board or from a file, at the user's option. If the user chooses file input, the program should request a file name. You may assume that there are fewer … | |
I am designing a system which will broadcast a message to all the nodes in a cluster.And the receiving node should send a feed back to the broadcasting node.When i get a single feedback from any of the receiving node, the broadcasting node should stop receiving the feedback.With that feedback … | |
Aelphaeis here with another little problem. In the Code below I attempted to make a generic function which read a line up to a newline character and then returned the string. The program reads as follows [CODE] #include <stdlib.h> #include <stdio.h> #include <strings.h> int getstring(char *string,int max); int main(int argc,char … | |
im trying to write a program to see if two lists are equal im really kinda lost at the moment, i havent gotten the compare function yet but i think that should be pretty easy, but im having some errors which u can see. [code=C] #include <stdio.h> #include <stdlib.h> typedef … | |
I have a very simple one line function and i want to replace it with macro, but macro doesn't seem to work. Function: [CODE=C]int stack_empty(stack ** this_stack) { return *this_stack == NULL; }[/CODE] Macro i am trying to use: [CODE=C]#define stack_empty(x) (*x == NULL)[/CODE] Anybody knows what i am doing … |
The End.