15,551 Topics

Member Avatar for
Member Avatar for zawpai

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 …

Member Avatar for ssharish2005
0
118
Member Avatar for jobs

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 …

Member Avatar for ssharish2005
0
116
Member Avatar for n.aggel

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, /* …

Member Avatar for n.aggel
0
104
Member Avatar for Jishnu

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.

Member Avatar for Jishnu
0
356
Member Avatar for jobs

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 …

Member Avatar for kv79
0
668
Member Avatar for kv79

How to make win32 app with login? Is there some command or i need to make my function by myself?

Member Avatar for dubeyprateek
0
91
Member Avatar for jobs

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.

Member Avatar for jobs
0
3K
Member Avatar for death_oclock

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.

Member Avatar for death_oclock
0
104
Member Avatar for kv79

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); …

Member Avatar for kv79
0
76
Member Avatar for kv79

Hi i always mix up a NULL and '\0' and 0. Can you write me when to use these things?

Member Avatar for kv79
0
184
Member Avatar for Archimag

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 …

Member Avatar for Archimag
0
161
Member Avatar for jobs

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 …

Member Avatar for Jishnu
0
915
Member Avatar for jobs

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 …

Member Avatar for yagiD
0
108
Member Avatar for zawpai

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

Member Avatar for zawpai
0
157
Member Avatar for Valmian

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 …

Member Avatar for Duoas
0
386
Member Avatar for temyreal

Hello all, i have a little problem printing the upper symmetry of the multiplication as shown in the attachment (in C). can anyone help?

Member Avatar for temyreal
0
85
Member Avatar for jobs

[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 *)?

Member Avatar for Narue
0
348
Member Avatar for jobs

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

Member Avatar for Narue
0
108
Member Avatar for jobs

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 …

Member Avatar for Ancient Dragon
0
87
Member Avatar for sitaag44

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 …

Member Avatar for poiuy
0
110
Member Avatar for varsha0702

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; …

Member Avatar for Beair.GQ
0
134
Member Avatar for Ancient Dragon

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] …

Member Avatar for Ancient Dragon
0
313
Member Avatar for Bamirasta

[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 …

Member Avatar for Narue
0
91
Member Avatar for mjoshi

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: …

Member Avatar for Narue
0
139
Member Avatar for stubBuddy

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 …

Member Avatar for stubBuddy
0
176
Member Avatar for george22_jk

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 …

Member Avatar for Salem
0
177
Member Avatar for azalia

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 …

Member Avatar for Narue
0
87
Member Avatar for samari

[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??

Member Avatar for Colin Mac
0
183
Member Avatar for jobs

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 …

Member Avatar for WaltP
0
1K
Member Avatar for jobs

[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 …

Member Avatar for Ancient Dragon
0
105
Member Avatar for n.aggel

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 …

Member Avatar for Barefootsanders
0
94
Member Avatar for stilllearning

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.

Member Avatar for ssharish2005
0
220
Member Avatar for Angel V

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--) { …

Member Avatar for ssharish2005
0
105
Member Avatar for jobs

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 …

Member Avatar for ssharish2005
0
102
Member Avatar for satya.vijai

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 …

Member Avatar for ssharish2005
0
110
Member Avatar for emilio

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 …

Member Avatar for Duoas
0
104
Member Avatar for tgnelson85

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, …

Member Avatar for Salem
0
183
Member Avatar for emilio

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 ** …

Member Avatar for emilio
0
83
Member Avatar for rizrash

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 …

Member Avatar for Jishnu
0
188
Member Avatar for savinashr

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 , …

Member Avatar for savinashr
0
65
Member Avatar for makubexiii

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), …

Member Avatar for Nick Evan
0
2K
Member Avatar for degamer106

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 …

Member Avatar for aikem-un
0
1K
Member Avatar for its.romi

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 …

Member Avatar for Narue
0
119
Member Avatar for jpaulite

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..

0
59
Member Avatar for stolson

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] …

Member Avatar for AndrewWood
0
627
Member Avatar for vkiller

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 …

Member Avatar for Salem
0
200
Member Avatar for kfupm

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

Member Avatar for Salem
0
76
Member Avatar for maye13

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; …

Member Avatar for maye13
0
118
Member Avatar for jsmith9990

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 …

Member Avatar for Narue
0
108
Member Avatar for redaqen

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 …

Member Avatar for deadswitch
0
77

The End.