15,551 Topics
| |
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?? | |
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 … | |
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 … | |
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: … | |
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 … | |
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... | |
In the program, it can calculate the summation and subtraction of two integers. The integer can have 100 digits and can also be negative. How can i do this ? | |
Hi, I am facing a problem, I am accessing a text file through my C program to fetch some values. The problem is that, i want to check whether the text file is updated before opening it, as i want to save the time of opening the file again if … | |
[code=cplusplus] #include<stdio.h> #include<stdlib.h> #include<iostream.h> main() { FILE *fp,*fp1; int numbers[30]; char *buffer; int i=0,j; // To read the file fp=fopen("PR1.txt","r"); if(fp==NULL){ printf("Error: can't access file.c.\n"); exit(1); } else { printf("File opened successfully.\n"); for(i=0;i<10;i++) { // while(!feof(fp)) { /* loop through and store the numbers into the array */ printf("Number- %d", … | |
Hi All, I am trying to write a common function called call which will take in a void* and an int type. Based on the int type it will have access to different structures. The code doesn't compile in the first place. I am not sure this is correct or … | |
I am trying to produce a program which produces a random array of numbers but I am running into a problem in that when the array becomes even a little large, say 10x10, I get the Bus Error or Segmentation Fault (I think I still get the error with even … | |
I'm doing a OS class. Trying to implement this pseudo code: * Forking is fun! Simple tips First, fork the child process: pid_t ForkPID; ForkPID = fork(); Then write a quick switch statement! switch (ForkPID) { // -1, fork failure case -1: printf("Error: Failed to fork.\n"); break; // 0, … | |
I need a statement to exit my program after goto statement but i dont know where to place this statement. The statement is: [CODE=c]printf ("Enter \".\" to exit or \"p\" to proceed"); scanf("%c",&ch); if (ch=='.') getch(); if (ch=='p') goto repeat;[/CODE] also tell me if its rite or not? [CODE=c]#include<stdio.h> #include<conio.h> … | |
If I allocate memory to a pointer which has been declared inside of a function as static, and don't free() it, is that memory freed when the function returns? | |
Hi....I need to convert a 1D array into a 2D array of numbers....can anyone help me out with this? the problem goes like this... I have a string of numbers say.. 0.123762 0.346515 . . . . . to a total of 275. i need to group them in the … | |
Hello Once Again..... I need you to help me with this program im working. My teacher asked me to create a program that could arrange the random numbers from lowest to highest.... but I can't follow up what's next in my program: [CODE=SYNTAX] #include<stdio.h> #include<conio.h> int main() { int a,b[10]; … | |
hi again can u tell me how can i call the date function in "c"? |
The End.