15,551 Topics
| |
I am having the hardest time figuring out how to pass a pointer as an argument. All of the examples I have come across are using predefined array sizes while my array is dynamic. The following code is a simple representation of what I am trying to do in a … | |
Anyone can tell me how to do this question: A program that creates an array of 5 student names and an array of 5 student Ids. You can choose to input the values or directly assign them. The program should then create two threads. The first created thread executes a … | |
I have to rewrite the atoi function - that is, convert a string given by a command line argument and convert it to an integer. It works for single digit numbers, but when you give it two or more digits, it only converts the first number. I'm not sure what … | |
am having these errors: /home/Desktop/L5Q1.c: In function ‘main’: /home/Desktop/L5Q1.c:15:9: warning: incompatible implicit declaration of built-in function ‘printf’ /home/Desktop/L5Q1.c: In function ‘funct1’: /home/Desktop/L5Q1.c:26:9: warning: incompatible implicit declaration of built-in function ‘printf’ [CODE]#include <pthread.h> void * funct1(void * arg); main() { pthread_t threadid; int i,j; int x=1; pthread_create(&threadid,NULL,funct1,(void *)&x); for (j=0; j … | |
hello everyone... i ve got this txt file and i want to scan it and insert the 2nd row digits at profit[ncustomer] matrix, where ncustomer is the 1st digit which readed from file. After that i want to add all the other digits in a 2 dimensional matrix dis[ncustomer][ncustomer] ... … | |
am having these error: /home/Desktop/L3Q3.c: In function ‘inputStudent’: /home/Desktop/L3Q3.c:23:2: warning: format ‘%d’ expects type ‘int *’, but argument 2 has type ‘int’ /home/Desktop/L3Q3.c: At top level: /home/Desktop/L3Q3.c:27:27: error: expected ‘)’ before ‘std’ Help please? [CODE]#include<stdio.h> typedef struct student { char surname[20]; char oname[20]; char address[20]; int age; }stud; void inputStudent(stud … | |
Can someone help me with these lines of codes?it gives me this error: /home/Desktop/L3Q2.c: In function ‘main’: warning: format ‘%s’ expects type ‘char *’, but argument 2 has type ‘char (*)[20]’ /home/Desktop/L3Q2.c:19:2: warning: format ‘%s’ expects type ‘char *’, but argument 2 has type ‘char (*)[20]’ /home/Desktop/L3Q2.c:22:2: warning: format ‘%s’ … | |
A program that accepts two positive integer values x and n, and uses a function to calculate the value of x raised to the power n. The function should calculate power by repeated multiplications. The result should be returned to the main function and displayed. I use linux terminal to … | |
This code is give in a data structures book I issued from my library. I am not able to understand how the functions are working. I am aware of the algorithms. Can anyone please explain how qinsert(),qremove(),build(),encode() are working.Please explain in detail [CODE]#include <stdio.h> #include <string.h> typedef struct node_t { … | |
Write a program containing a function that takes 2 integer parameters x and y and returns the value of x2 + y2. The main program should then allow the input of two integer values a and b and display the value of a2+b2. Can someone help me?am having this error: … | |
What are the settings I require so I can debug line -by line? Or else ,I can identify lines of code where run time errors are occuring.. I want to view exact line number of error in this code/[CODE]#include<stdio.h> #include<conio.h> #include<string.h> struct node {struct node * left,*right; int freq; char … | |
Hi, I having problem with enter file name to read file it give me result like this [CODE] Please Enter Ship File path or Ship File name: data Segmentation fault: 11 [/CODE] Here is my code [CODE] #include <stdio.h> #include <stdlib.h> struct harbour { int harbourId; int maxCap; int timeUpload; … | |
Hello Daniweb! :) I am brand new to this site, and wish I didn't need the help but I do! So let's give it a go shall we? I have a program I have been working on for about two weeks now, and I feel like it should not be … | |
| I have my program working and logic correct and I'm able to use another function and just fine, but my requirements are to pass the addresses of my three variable hour, min, sec, not the actual variable itself (which is declared 0 when it reaches the time() function) I've just … |
Does anyone know any good websites that offer programming tutorials. Maybe similar to Kahn Academy, with videos and exercises. | |
Hi i want to know if C is the best language for image manipulation and creating a steganography tool?, if so how would i go implementing steganography and can anyone recommend any reading materials and libraries needed. | |
[CODE]#include<stdio.h> #include<conio.h> #include<string.h> struct node {struct node * left,*right; int freq; char c; }; typedef struct node node; int front=1; node * q[256]; char * code[128]={0},array[1024]; node * new (int freq,char c,node * a ,node * b) { node * n=(node *)malloc(sizeof(node )); if(freq) {n->c=c; n->freq=freq;} else {n->left=a;n->right=b; n->freq=a->freq+b->freq; } … | |
hi there) guys, plesae tell me - what should i change in this code to see message in a console window (i also need define the OS) = [CODE]#include <stdio.h> #if defined(_WIN32) || defined (_WIN64) #include <windows.h> #define WINDOWSS 1; #endif int main() { char* mtext = " Please specify … | |
can you pls give me a link to where i can download a free turbo c? | |
Hi I dont know why when I run in xcode it give me exec bad access but when I run using terminal it work fine Here is mt code [CODE] // // main.c // Harbour Unload System // // Created by Guide on 15/10/11. // Copyright 2011 __MyCompanyName__. All rights … | |
does anyone know where to start on this i want to make a command line c program which hides messages in images and audio files is there any books i can read to get this started | |
Hi, I get a output result: Segmentation fault: 11 when I tried to do quick sort a time in ship structure Here is my code [CODE] #include <stdio.h> struct harbour { int harbourId; int maxCap; int timeUpload; double amount; }; struct ship { int number; int shipId; int sMaxCap; int … | |
Hi, i've a problem and hope you can help me :) I was seeing other post [url]http://www.daniweb.com/software-development/c/threads/269500[/url] but my problem is diferent... I want to copy some content of a webpage to make a db in different locales. The webpage by example is web.com/name=123, 123 is the id. The page … | |
i have an project encrypting an grayscale image in c language. Before encrypting first i want to calculate its header that define it file format, and convert image data into a binary value. i don`t know how to do this please help me? | |
Can anyone give me starting ideas about creating B-Tree? For example,how to define a node structure in a B-tree? | |
I am trying to read in a command-line argument like: >a.out memtest -b 4 -s 1000 And the intended result is to store "4" in the variable represented by -b and store "1000" in the variable represented by -s. I have the following code: [CODE]int main (int argc, char **argv){ … | |
| I have two programs here I cannot seem to get any return value and I have no idea why, everything I'm doing is just like my book says and I cannot get it working. The parts commented out are the other ways I was trying to make this work, somethings … |
[CODE]#define max 50 struct code{int bits[max];int start;};typedef struct code code; struct node{int freq;int father;int isleft;};typedef struct node node; void insert(int,int); int del(int); main() { code cd,code1[max]; node node1[max*2-1]; int i,k,n,p,p1,p2,root,rootnodes; char symb,alph[max]; for(i=0;i<max;i++) alph[i]=' '; rootnodes=0; scanf("%d",&n); for(i=0;i<n;i++) { scanf("%s""%d",&symb,&node1[i].freq); insert(rootnodes,i); alph[i]=symb; } for(p=n;p<2*n-1;n++) { p1=del(rootnodes); p2=del(rootnodes); node1[p1].father=p; node1[p1].isleft=1; node1[p2].father=p; … |
The End.