15,551 Topics
| |
Hello, i found your forum useful from time to time while i was an absolute beginner in C language. And i'd like to thank you all for that. Now i have a problem i don't have too much time to solve, so i was wondering if any of you guys … | |
Hi all, I have written recurisve pathfinding fuction from matrix[i][j] to matrix[x][y]. however, it's not returning the right values. It is supposed to return the minimal cost from 2 points using any possible path. all ".value" are the cost to use this Node all ".bestFromStart" are the max of long … | |
Hey, does anyone know if it possible to have something like [CODE] #DEFINE NUM_DEC 4 printf("This is your value:%.NUM_DECf\n"); [/CODE] thanks in advance | |
If I know the sizes I'm using, I can declare the array as: [code]char arr[20][20];[/code] Is this correct? Well, I want to know how to insert a full string into the array of strings. I thought it might be: [code]fscanf(infile, "%s", *arr[i]);[/code] but this line gave me the error "warning: … | |
Hi All, The gap between consecutive prime numbers 2 and 3 is only 1, while the gap between consecutive primes 7 and 11 is 4. Can somebody help me in writing a parallel program to determine, for all integers less than 1,000,000 , the largest gap between a pair of … | |
Hello, I've been having trouble trying to duplicate this program. My output differs from the sample output I was given for homework. I don't understand whats wrong with my code. [CODE] void displayUnion( iUnion ); union integer_union { char c; short s; int i; long l; }; typedef union integer_union … | |
Hellooo I m Sharan I m student of BCA I hav problem in file structures | |
Hi all, I am trying to point a pointer to another pointer and just failed to get resultm here's my failed code, [code] char *point[] { "This is One" "This is Two" "This is Three" }; char *ptr; ptr = point[2]; printf("%s\n", ptr); [/code] I am getting single space printed … | |
Hi All, I am currently trying to write a program that can read individual sectors on a floppy disk using C. I am building the program to run in a 16-bit DOS environment using the Digital Mars compiler with the 16bit DOS add-on. So far I know how to access … | |
Hi , I am trying to use XDR to encode an integer variable. I am trying to use xdr_int function [icode] xdr_int(&xdrs, &i); [/icode] But to use this function I have to set XDR_ENCODE somewhere. I am unable to go about how to do this. How should I proceed? | |
Guys.... I am writing a shell .I've managed to get the input from the user through a string and then I've tokenised it. Now the problem is do i need to know weather its a programme or should i continue to fork it without knowing it. As all of u … | |
printf("\nThe Result is : %s %s %s %s %s %s %s %s\n",var[0],var[1],var[2],var[3],var[4],var[5],var[6],var[7]); while executing this i get correct result upto var[4].... and for var[5] and var[6] im geting some garbage valuess, then for var[7] im getg my result... whats wrong in my code..... | |
please write a programme to sort array of integers using quick sort | |
Given a n*n grid with free spaces and obstacles in the form an n*n integer matrix. We need to find shortest between any two given points (x1,y1) and (x2,y2) through the free spaces. We are not allowed to move in diagonal. Please help me figuring out an algorithm for doing … | |
Hi, I'm new to C, and an assignment for multithreading was just kind of thrown at me, so I'm kind of lost. I need to write a program that creates four threads. The first thread would have to read stdin, writes the char to array of 64 bytes, and after … | |
okay guys, plz help, this is so wierd. I am not an expert in C, in fact, not an expert in anything. I defined a struct as the following: [code=c] typedef struct Fact { char predicate[MAX_TOKEN_SIZE]; struct Fact* valuePtr; struct Fact* next; }Fact; [/code] and i have some code like … | |
how can i declare this correctly: because i always get an error like, too long declaration. Type of food Name Address Average cost Thai ABC Makati 250 American DEF Pasay 350 Asian GHI Manila 150 Thai JKL Muntinlupa 300 Thai MNO Paranaque 350 American PQR Manila 200 Asian STU Makati … | |
Hi I am Gaytri i would like to know:- why we use main() function in C. And what is advantages of main() function. | |
Hey guys i was wondering if any of you could help here. I've looked around the forums and found a few topics on word_count, the problem is that they use codes that my class hasn't gone into yet so i cant use either. My problem is that we are supposed … | |
Hello friends, Need help in generating random numbers from an array without repeats.Once a number is generated, the number has to be deleted from the array so that only the remaining numbers can be generated from the array the next time we call that function.And it should go on until … | |
I'm in the middle of writing a program where I want to use a single function to grab a Username from one file and a Password from another file. The idea is to pass the file pointers to the function so that each time the function is called it returns … | |
Hello there! I need to open PDF files from a C program. So, initially I have this solution: [code=c] ShellExecute(GetDesktopWindow(), "open", "c:\somefolder\myFile.pdf", NULL, NULL, SW_SHOWNORMAL); [/code] However, this code has its limitations: 1. It works, but a shell window comes up and closes when opening the PDF file. Is there … | |
I was trying to find the right answer to the question below and here are the 2 answers I come up with: srand(time(NULL)); or srand(clock()); If we want the random number library function to produce a different sequence of values each time the program is run which of the following … | |
I would like to ask about how to use the timer too... how to use set_timer0, get_timer0, what is the meaning of the value of set_timer0(0)... because I am doing a program that will have a digital waveform, which have high and low voltage...I would like to use timer to … | |
I need to get a pointer to a particular member variable of a structure Here's what i have done [code] typedef struct { int var1; other variables ... } structname; ---some other code here--- structname* structptr; int* intptr; intptr=(int*)&(structptr->var1) [/code] but this isn't working. What's the correct way to do … | |
Hi. am using fgets() to read lines from a text file. the file is being updated after a few seconds. i want to read and process the last appended line at the end of the file. i tried the following: [code=c] while(true){ //infinite loop if(fgets(line,size,fp)!=NULL) process line. } [/code] plz … | |
HI can some one figure out my mistakes in this program? [CODE=C]#include<stdio.h> #include<conio.h> void main () { int num,i; clrscr(); printf("\nprint any number:"); scanf("%d",&num); for (i=2; i==num; i++) { if (num%i==0) printf("\nprime number"); else printf("\nnot a prime number"); } getch(); }[/CODE] i want that it tell the user whether the … | |
Hi there, I am trying to write a program to send an HTTP request (eventually to view the raw HTML page) but i can't seem to get my requests to send or receive properly, intially when i ran this it would receive about 4190000 bytes (rough guess) but after running … |
The End.