15,552 Topics
| |
Hello All i am trying to compile a simple code for the strtok but getting the error as segmentation fault ( core dumped ) .. any help would be appreciated. [CODE] #include <stdio.h> #include <netinet/in.h> #include <stdlib.h> #include <string.h> main() { char *test="asim.nazeer.helo.me"; char *rsl=strtok(test,"."); //while(1) //{ printf("%s",rsl); //} } … | |
I'm trying to determine the minimum range of floating-point types. It's easy when using values from standard headers: [CODE]#include <stdio.h> #include <float.h> main() { printf("Minimum range of float variable: %e\n", FLT_MIN); printf("Minimum range of double variable: %e\n", DBL_MIN); return 0; } [/CODE] This code gives the following output: Minimum range … | |
| hello people is anyone of you able to tell me the heuristic i can choose in order to allow my robot to move from the doo to the issue in a labyrinth ? |
I am trying to find the longest common prefix of two words entered by the user. I don't understand what is going wrong. I keep getting this error when I compile: [CODE]prefix.c:11:13: error: expected declaration specifiers or '...' before '(' token [/CODE] And this is my code: [CODE]#include <stdio.h> #include … | |
[CODE]void numToEnglish(unsigned int num, char english[]); main() { char* first20[] = {"zero", "one", "two", "three", "four", "five", "six", "seven", "eight", "nine", "ten", "eleven", "twelve", "thirteen", "fourteen", "fifteen", "sixteen", "seventeen", "eighteen","nineteen"}; char* tens[] = {"twenty", "thirty", "forty", "fifty", "sixty", "seventy", "eighty", "ninety"}; printf("Enter an integer between 0 and 999: "); scanf("%s",s1); … | |
hello every body, I am a new prog.in C.My final yr project based on incrementing ipv6 address by 1.The address format is - fe80:0000:0000:0000:0204:61ff:fe9d:ffff So the result will be - fe80:0000:0000:0000:0204:61ff:fe9e:0000 User enter the valid ipv6 address and final result will be +1 incremented.Its a incrementation of hex.value. It also … | |
Hi, I want to declare an array of constant values in my header file, and this array cannot be changed in the main code. const uchar x[4] = {1, 2, 3, 4} does not work, cos the linker will complain that the address space overflow. Is there any way to … | |
please tell me the answer of this question.it is irritating me a lot. i have searched many books but not getting it.please help!! | |
Can any one please tell me that why turbo c is not supported by windows 7?:?: | |
This is the problem I have Read in 10 numbers, 10<numbers<100. As each number is read, print it only if it is not a duplicate of a number already read. I did the first part but couldn't work out the second,where the duplicate is used. I have some idea in … | |
I was asked to write a program, based on parent-child cooperation, which uses a “parallel” merge sort to a sequence of 800 numbers from a text file.I have to read the sequence of 800 integers, which I store in an array, and then pass half of them to a child, … | |
hello guys how properly push,pop,display a char array into another char array, when come to int i can do but in char array its to hard to analyze.. pls guy need some help. thnx in advance | |
Hello everyone. I am to program a simple shell in C for my project. So far my shell can execute simple commands and now I want to implement enviroment variables. I looked up on how to use the getenv, setenv, putenv. So far so good i've tried to use the … | |
I've been stuck on this for hours because I really don't understand file descriptors and how successfully print a file to one. Basically, I want to be able to open a file and then echo its contents a character at a time to a socket file descriptor. The code below … | |
On my development board, I am trying to make 8 LEDs (0 - 7) blink one by one. Here, is my code. What do I need to change to get my desired output, Please help. [CODE]int main (void) { int a,b; DDRC = 0xFF; PORTC = 0xFF; num = PORTC; … | |
i have to create a graph by taking names of movies and the actors in that movies from a file. i have to create the graph and after i have to show the connection beteween the actors. does anyone know how i should do that in c? i prefer if … | |
Dear All, I have a struct as below and a pointer to the struct as such const struct pfring_pkthdr *h. I want to get all the value to be made one string delimited by comma to be inserted into db. So how to do it in C? E.g I want … | |
hi guys i need help. In fact it's an assignment. I'm fed up with this stuff. This is my code. has got many errors. actually it's just messy. please provide me with me a code [CODE]#include <stdio.h> #include <string.h> #include <stdlib.h> #include <stdbool.h> #define MAXWORDS 5000 /* max no of … | |
I've been tearing my hair out over this for quite a while now. What I'm trying to do is populate the struct array from within a function but I cannot figure out how to do it. Everything I've tried throws up a syntax error. Ideally the data should be entered … | |
can someone help me? i am new to C, i meed to read file which looks like this Month Date Day Activity Repetitions January 1 Monday brushed_teeth 9 January 1 Monday combed_hair 5 Then i need to do calculations in the reps and month | |
i have a 6x6 array . a certain object randomly moves within the boxes , i need to count the steps he makes for him to able to step all the boxes , i dont know what to do nxt with my code . the dot represents the boxes : … | |
Hi all, I have a problem with my code. I use in a struct variable type time_t with name tt like [CODE] typedef struct{ time_t tt; } [/CODE] then I initialise in the main function of my server [CODE] time_t timer; timer=time(NULL); [/CODE] I pass the timer in my shared … | |
i have an assigment to fork the main program to 4 sons each will sort an array in a different way [ICODE] for (sonID=0;sonID<4;sonID++) { status=fork(); if (status<0) error("Can't Fork!"); if (status==0) { checkFiles(argc,argv,&in,&out,sonID);// opening the files for use readFromFile(&nameList,&sizeOfList,&numOfStrings,in); sortArray(numOfStrings,&nameList,sonID); outputToFile(nameList,numOfStrings,out); //output the array to out file freeArray(sizeOfList,nameList); //freeing … | |
I am trying to create a program that creates a loop to enter different values in an array. but the program is skipping values of i. I can't understand why.. [CODE] #include<stdio.h> int main (void) { char s[10]; int i; for (i=1;i<=10;i++) { printf("enter %d'th value of the array 's'\n",i); … | |
Im still learning C and I have a few questions about making a array of strings. Im doing an assignment for school, and I'm a little stuck with my program. Here is my code so far: [CODE] #include <stdio.h> #include <stdlib.h> int main(int argc, char *argv[]){ FILE* fin; int a; … | |
I have been working on this code for quite a while and have not been able to figure it out. I looked online and through the forums and could not find something that showed how to fix it. This program takes in the julian date ie. 12df234(first two # are … | |
Hi, I have installed Turbo C compiler on windows vista (32 bit). Set the PATH variable to properly point to tcc.exe under C:\TC\BIN; I created some C files under C:\TC\myfolder I tried compiling using [CODE]C:\>cd TC\myfolder C:\TC\myfolder>tcc -P-c file.c[/CODE] Sometimes it says file not found while other times it compiles … | |
Hello everyone. I have a problem using strtok in C. I get a user input from the command line and I want to tokenize it with pipe ("|") as the delimeter and put the result in a double pointer variable. Here's my code: [CODE]char** argv; char *token; token = strtok(userInput, … | |
Hello I have a question regarding linked list: The assignment I was given was rather large so I'm not going to go into the full details of what exactly it does and give you just what is needed to answer the question. First we have a student records structure [CODE]typedef … | |
[CODE]#include<conio.h> #include<string.h> //prototype declaration int pnc1(FILE *fp); int pnc2(FILE *fp); int findstr(char *p[], char *name); int sum_array(int a[][], int element); //function to pick data and then convert bits to number // for notes_disp , notes_req int pnc1(FILE *fp) { int tot=i=j=k=0; i=getw(fp); j=getw(fp); k=getw(fp); tot=(100 * i) + (10 * … |
The End.