19,876 Topics
![]() | |
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 … | |
Hello, I wrote a program which takes CNF-files as input. It takes from 1 sec up to 1 hour to finish its task (Checking satisfiability). However, there is one CNF file which takes about 1 hours before it spurts out the message: aborted <core dumped> ... and creates an *.exe.stackdump … | |
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 … | |
Im learning ++ by myself and have decided to follow this tutorial and very interesting [url]http://www.cprogramming.com/tutorial/lesson4.html[/url] However as you can see the int mult ( int x, int y ); is defined twice: at the top and the bottom. Whay it is that. Also I have found many programs uses … | |
I am working on a programm that requires one to write a program that outputs your first and last intials in block letters. The block letters should be made up of small letters that match your block letter. If PS is the block letter then p should be made up … | |
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 … | |
in C# if you add @ before your string literals the escape sequences are not processed, so : you can use : [CODE] @"c:\Docs\Source\a.txt" // rather than "c:\\Docs\\Source\\a.txt"[/CODE] is there any c++ equivalent of doing that? Thanks | |
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 … | |
Hello Daniweb IT Community, this is the somehow my code for this problem of mine. My only problem would be in the portion of getting the cents and the Billion it just because of the limitation of the long datatype? I really need some opinions on how I can solve … | |
Hi can anyone please tell me, How to see the assembly code generated from C program?? | |
I was wondering how would i make a call to a function inside my C# code with out reloading the page from inside Flash? Thanks | |
Hi lately i have been studying the malloc and calloc functions for dynamically allocating memory. I thought the form was: [code=C] (data_type*) malloc(data_size); [/code] But then I stumbled onto this code snippet on a tutorial site: [code=c] #include <cstdlib> void *malloc( size_t size ); [/code] Why is the data type … | |
Ok I know, scalar() function uses po1→x to access the first member of a structure. Can po1.x or (*po1).x be equally used within the function to access the same member? | |
Hi, Back in the 70s or 80s I wrote a c program for running a Tote at a Race Night - an evening where films of horse races are shown for people to 'bet' on the winner. Not really betting - more like a raffle - but my program enabled … | |
Hello everyone, I have created my own header file but it doesn't work if i just include like "myfile.h" and it works fine if i include like "myfile.c". I just want to know that why this thing happening in Turbo C compiler even it works fine in VCpp. | |
Hi, guys i need some help! i need to make a txt file with the "-A" command (in shell). that already is implemented in the client, then the client send the file thru sockets and arrive to the server, the server save the file in his directory. But the code … | |
Hello to all, I am doing a serial communication program in which i want to send '80' (in hex ) to DSP and then DSP will reply '1B' . But i am not able to set proper communication. Anybody please help me in my software My Program is given below … | |
I would like to ask that PrintHello accepts a void pointer but how come you can equate it to an integer directly ??? " tid = (int)threadid; " while at the same time instead if a pointer a normal variable was passed into this function " pthread_create(&threads[t], NULL, PrintHello, [B](void … | |
Write a Program that models a simple calculator. Each data entry line should consist of a valid operator (from the list below), and the right-hand operand. Assume that the left-hand operand is the accumulated value in the calculator, with an initial value of 0.0. Acceptable operators: + ..Add - ..Subtract … | |
I'm new in programming, i really really want to learn and i think i can learn faster if someone will give me problems so that i can answer them without asking for help from others. Now, i learned loop last week so i think i'm on for making programs. I … | |
Hello Daniweb Forum People, I have this problem of getting the decimal of a number? How can I get it and copy to a variable? ex.... 1234.59 I used a for loop in order to get the index value of 59, my problem was with the value? how can I … | |
I Have been working on this for a few days now, and I seem to be missing something. What I have to do is: > Design a C# solution with a Main ( ) method that holds an integer variable named seconds to which you will assign a value. Create … | |
This is a little program I'm writing to refresh my knowledge of C and I know it's wrong, but everything I've tried in order to fix it isn't working. [code] #include <stdio.h> #include <string.h> int main() { int const STR_LENGTH = 255; char str[STR_LENGTH]; int n=0,i=0; printf("Please enter a word: … | |
I need to write a C++ program. I'm usually pretty decent with C++ but with this one I'm lost. I have to write a program that basically checks to make sure that the braces creating a block in a cpp file are balanced. I'm not looking for anyone to write … | |
Greeting All, Peace. New to this forum and am confused about how to approach data analysis of variables with C++. My question I is am simply going to do simple descriptive statistics (mean, mode, variance), and a little more complicated chi square / correlation (Pearson). The approach that I am … | |
hi everyone....i have to convert decimal numbers starting from 1 to 1024 into binary and i need access to all the bits. i have done an example which generates a random number and converts it into a 10-bit binary number. this one worked fine for me... [code=c] for(i=0;i<10;i++) { sec[i]= … | |
1.CREATE A FUNCTION [U]void mycpy[/U] to copy a string. 2.CREATE A FUNCTION [U]void mycat [/U] to cut and append a string unto another string. 3.CREATE A FUNCTION [U]void mycomp [/U] to compare whether two strings are the same or not. The prototypes of the functions are 1. Void mycpy(char*,char*) 2. … | |
My coding looks like this int main(int argc, char *argv[])/*command line input*/ { int len; char *t[10]; len=strlen(argv[argc-1]); temp[0]=argv[argc-1] if(strstr(t[0],"c"==NULL)/*to check for a c file input*/ printf("Not a c file"); else printf("C file"); } if my command line input in linux is ./a.out test.c argv[0] contains ./a.out ans argv[1] contains … | |
hello i wrote a c++ program, and i wanted to send it to my friends, but everytime i send the exe file to them, they tell me they get the error: "The application has failed to start because the application configuration is incorrect". I tried to put it on rapidshare, … | |
I am getting some errors. 4 are C2143 2 of which point to the function prototype void ArrayFunc(int, int, float, int[SIZE][2],float[SIZE],int &,int &); and the other 2 C2143 errors point to void ArrayFunc (int count, int hours, float total, int array1[][2], float array2[], int &row, int &column) (the function definition). … | |
![]() | Hi there, Think this is a pretty simple problem! I'm trying to create a header file with some physical constants. The Planck constant is giving me trouble due its tiny size in SI units. Essentially, defining a pre-processor constant using E-notation does not seem to work. My header file looks … |
if (blink_status ==1){ //If led is bliking, stop it P1OUT &= ~ 0x01; // Turn Led off blink_status=0; }else blink_status=1; } Could anybody explain the logic please... |
The End.