15,551 Topics
![]() | |
Hi , Could you please give me some suggestions? I would like to create a small buffer in my code because the memory of the hardware is quite small. If so, it can't receive all of the data that I send. Sometimes, the data are over write. How should I … | |
strcpy(buf, "my_id_%d_",i) strcpy(buf1, "my_com_id_%d", j) First I want to place value of i into "my_id_1" like so and copy to buf. And do the same thing in second line the code. Now I want to join both buf and buf1 so it will give me a new string "my_id_1_my_com_id_2". How … | |
hi, i am reading the book "Operating Systems Design and Implementation 3rd edition" which analyzes the minix source code... in the part of filesystems we see this code [CODE=c]PUBLIC _PROTOTYPE (int (*call_vec[]), (void) ) = { no_sys, /* 0 = unused */ do_exit, /* 1 = exit */ do_fork, /* … | |
Hello, I know this much that I want to include two files in my program. But can I decide which files to include at run time? Is this possible? Thanks in advance, -Jishnu. | |
I am getting an error when I do this in C program: execl("/bin/cp","../data/data_.txt","../data/data.txt",0); error is as follows: ../data/data_.txt: missing destination file operand after `../data/data.txt' Try `../data/data_.txt --help' for more information. I tried this too, it didn't help. execl("/bin/cp ../data/data_.txt ../data/data.txt",0); All I am trying to do is this: cp ../data/data_.txt … | |
How to make win32 app with login? Is there some command or i need to make my function by myself? | |
int file file = open("./some.txt", O_RDONLY); Above line file=open giving me compile error: 'O_RDONLY' undeclared (first use in this function) What is the problem here? I am running linux and gcc 4.1. | |
If I call the MessageBox function: [CODE]MessageBox(NULL, "Message", "Message", MB_OK);[/CODE] for example, the box will not appear. It will make the beeping sound, though. | |
Hi , [code=C] /* Inputs a list of strings from the keyboard, sorts them */ /* in ascending or descending order, and then displays them */ /* on the screen. */ #include <stdlib.h> #include <stdio.h> #include <string.h> #define MAXLINES 25 int get_lines(char *lines[]); void sort(char *p[], int n, int sort_type); … | |
Hi i always mix up a NULL and '\0' and 0. Can you write me when to use these things? | |
Hello people......just wondering if i can get some help.... I need to solve the next problem: We insert a number of students "k" and a number of chairs "n".....we need to print on the screen all the possible seating arrengments.....as one space always got to exist between two students.......the formula … | |
I have a config file which includes how many files I need to create. So my program reads the config file and will create those files. Where I am stuck is I do not know before hand how many File pointers I need. I get to know quantity of files … | |
When you read file in C and move to next line and so on. This seems you have to access file top to bottom sequentially without skipping lines. I need a way to read very 5th line or something similar to it. I am just concerned with data that is … | |
Hi all, I am zawpai. I would like to create the timer function in C to do some checking. Could you please show me how to write the code about it. Thanks, zawpai | |
Well hello.. I am making an CSV (comma seporated values) loader, in which the first row are strings and all the other are integers. From what I've got when I load each indivisual string into an individual char array first few char arrays when printed are twice as big as … | |
Hello all, i have a little problem printing the upper symmetry of the multiplication as shown in the attachment (in C). can anyone help? | |
[QUOTE]aptr = malloc(nrows * ncols * sizeof(int)); rowptr = malloc(nrows * sizeof(int *));[/QUOTE] What is the different with have no * inside sizeof(), eg sizeof(int), vs sizeof(int *)? | |
char stmt_buf[1024], buf[(1024*2)+1]; stmt_buf ="SELECT id, title FROM post LIMIT 5;"; I get an error: connect2.c: In function ‘main’: connect2.c:217: error: incompatible types in assignment | |
I am running linux. This problem maybe implemented many times over. I am not hitting right google search term. I need a way to send email from my c program, if that program fails to excute some other part of the code. Any gurus like to shed some light on … | |
Hi friends, I am sita I want to know more about storage class in C language.I think you can help me for finding out the answers. First of all Can you please tell about Local and Global variables? Or What are Local and Global variables? Can you please show some … | |
When I execute this code ,it accepts 2 nos,prints the msg enter your choice and terminates.. [code=c] #include<stdio.h> int main() { char ch; int a,b; printf("enter 2 nos :"); scanf("%d %d",&a,&b); printf("\nenter your choice:"); ch=getchar(); printf("%c",ch); switch(ch) { case '1': printf("sum : %f",a+b); break; case '2': printf("diff : %f",a-b); break; … | |
Its pretty rare for me to post questions here but I came across this one about qsort I can't answer. If I try to sort an array of character strings such as [icode]char array[255][20][/icode] qsort works ok as expected. But if I declare the array like this qsort fails: [icode]char*array[255][/icode] … | |
[I]<< split from the "[URL="http://www.daniweb.com/forums/thread66649.html"]removing the null terminator at the end of string[/URL]" thread >>[/I] But, Lets say what you have stored in your buffer is the contents of your file that you've open,. How do you get all the content of that file into your string without it stopping … | |
Hi, I want to write a program to split one file into multiple files. At any line that contains: "# Name:" i start writing to a new file. My problem is that i want to save each file with a name i extract from the same line. Example: # Name: … | |
The following code consists of 2 functions: one called Options and the other called checkOptions. The Options function is fine. No problem, it is taken from Johnson M. Hart's book. The second function was added on to attempt to complete an exercise at the end of the chapter. Okay, the … | |
hello i am george.i have to do 2 exercises in c/c++ and i dont know a lot of programming.the exercises are: 1) code for depth first search with adjacency list for every graph 2)code for Dijkstra algorithm with weight graph if somebody knows something(code,links,etc...) that could help me please contact … | |
I want to pass a float array from one function to another function I want to make use of the float array type(here container) [code=c] void funct1() { float container[4]={0.1,0.2,0.3,0.4} void funct2() ----(1) {return container;} } void funct3() { void funct2(); use container array; }void funct1() { float container[4]={0.1,0.2,0.3,0.4} void … | |
[code=c] void main() { TRISA=0x00; TRISB=0x00; while(1) { PORTB=0x06; PORTA=0x01; delay(10); PORTB=0x5B; PORTA=0x02; delay(10); PORTB=0x4F; PORTA=0x04; delay(10); PORTB=0x66; PORTA=0x08; } } [/code] This a few program that i make in creating a scoreboard for basketball using PIC 16f84a..Is this program correct?? | |
I have a C program I am writing and need this program to write to syslog and have the logs in a separate file for my program. Eg. My program is called "example.c", then I want to have a log file called "example.log" in /var/log. Do I define log file … | |
[QUOTE]The function time() retrieves the current calendar time from the system's clock. It has the following prototype: time_t time(time_t * tp); In systems in which no clock is available, the function returns -1.[/QUOTE] Part 1: I found this on the internet. I have a question about the above quote where … | |
hi, i have the following program [CODE]see the attachment[/CODE] when i try to compile through the command line {with the scipt compile} everything works fine... when i try to use my makefile...i get tons of errors.... It is my first serious try with makefiles and i would like some assistance … | |
Hi, I am trying to find the header file monetary.h and the function strfmon() to do some currency conversions, but Visual Studio 2005 compiler doesn't seem to support those. Does anyone know if there is an alternative function I can use ? Thanks a lot. | |
im trying to sort my random numbers to odd numbers and even numbers,, the last part of my code is really wrong.....(the sorting part) [code] my code: #include<time.h> int main() { int num[50]; int x,odd,even; srand(time(NULL)); for(x=0; x<50; x++) { num[x] = (rand()%60)+40; } for(x = 49; x>-1; x--) { … | |
Can someone tell me what value would each of the line of code will have, when you go through this code: Here is the full code: server.conf: [CODE]interface=192.168.0.2; log=/var/log/example; [/CODE] example.c: [CODE=c] conf_fd=open("/etc/example/server.conf",O_RDONLY); read(conf_fd,conf,100); close(conf_fd); /* Get server IP */ buffer=strtok(conf,";"); buffer1=strtok(NULL,";"); strtok(buffer,"="); server=strtok(NULL,"="); server_ip=inet_addr(server);[/CODE] What is the value at … | |
Hi, I need some information regarding the APIs to use, to get the drive letter, if I know the label of that drive. For eg, my hard disk has been partitioned into 3 drives, C:, D:, E:. The labels (label1, label2, label3 )for these drives have been assigned dynamically. I … | |
i have an array which contains third level pointers : [CODE]char * arrP1 [ ] = { "father", "mother", NULL}, * arrP2 [ ] = { "sister", "brother", "grandfather", NULL }, * arrP3 [ ] = { "grandmother", NULL}, * arrP4 [ ] = { "uncle", "aunt", NULL }; char … | |
Hello, C question here (running on Linux, though there should be no platform specific code). After reading through a few examples, and following one in a book, for linked lists i thought i would try my own small program. The problem is, I seem to be having trouble with memory, … | |
hello i have this code int main () { char * arrP1 [ ] = { "father", "mother", NULL}, * arrP2 [ ] = { "sister", "brother", "grandfather", NULL }, * arrP3 [ ] = { "grandmother", NULL}, * arrP4 [ ] = { "uncle", "aunt", NULL }; char ** … | |
HEY FRIENDS THIS IS MY EFFROT I'VE MADE A PROGRAM THAT'LL ADD OR SUBTRACT 2 AND THREE DIMENSIONAL MATRICES !! PLEASE SEND YOUR REVIEWS ABOUT THIS PROGRAM AND SUGGESTION ON WHAT IMPORVEMENTS CAN BE MADE IN IT !! AND ALSO I NEED TO KNOW CAN THIS PROGRAM BE MADE BY … | |
i need to use large integers of the size 1024 to 2048 in a cryptography project using C... are there any header files available which will make my work easier if not ... how do i hanlde these integers using structures ??? By handling i mean multiplication , exponentation , … | |
im a 1st year comsci student and we are given an assignment that will display in words the number that is entered using logical operators and what we've learned so far(printf, scanf,etc.) I only have problems in displaying the numbers from 11-19 (when I input 12 is displays two twelve), … | |
I did a quick search on the forums and there was another problem similar to the one i'm trying to solve. I'm supposed to use the first word of a sentence as a search parameter and check the rest of the string for occurences of the word. If the word … | |
Added binary Tree just to help others..... [code=c] #include<stdio.h> #include<conio.h> #include<stdlib.h> void formatting(void); int input(void); struct binTree* createNode(struct binTree*,int); void insert(struct binTree*, int); struct binTree* searchNode(struct binTree*, int); struct binTree* search(struct binTree*, int); void dispTree(struct binTree*); struct binTree{ int item; struct binTree *leftChild, *rightChild; }*root=NULL, *node; void main(void) { char … | |
guys would help...with my assign...this is the problem... create a program to input 8 words with maximum of 15 characters.display the words in alphabetical order...tnx.. | |
I have read in a file, and i can print it out successfully, but i must sort the pointer to the array of structures. below is my code. I must sort the phone book in ascending order by zip code. If anyone could please help that would be great. [code] … | |
I am workring on a program that can simulate an array of disks and from an event list, record their mean time to failure (mttf), mean time to repair(mttr) and stop the program when it encounters dataloss. so we would also need to record the mean time to data loss … | |
i want to ask if any one could help me with this Q how to approximat a square root???????? PLZ help me i want example | |
here's the program i'm trying to run, but everytime i press ctrl+f9.. i get the error in that picture below.. [code]#include<stdio.h> #include<graphics.h> #include<dos.h> #include<conio.h> #include<stdlib.h> main() { int choice; clrscr(); printf("Please choose a version you like: "); printf("\n<1> Random lang\n"); printf("<2> Moribund...\n"); scanf("%d", &choice); switch (choice){ case 1:{ ran(); break; … | |
Hi , i''m Smith. I want to know more abou C pointers . And its use in C. Friends, those who are interested in this topic please give me good idea . First of all i want to know About basic things about pointers. What is a C pointer? And … | |
Hey everybody, Once again, I find myself humbled and confused. You see, I have a text adventure engine (although at this point its just a map traversal... doesn't end yet :P) and I'm having a few issues with the commands. I can move around the map just fine and I … |
The End.