19,876 Topics

Member Avatar for
Member Avatar for vishalwiw@mail.

Hi all, I was trying to write a C program which round off the decimal number, here main intension is decimal digits can be of N digits. So problem I was facing to get last digit on which I have to take decision. Please check below C code - suppose …

Member Avatar for WaltP
0
144
Member Avatar for Crushyerbones

Hello guys, I'm trying to make this work [CODE]all: daemon client daemon: cd ./daemon; make daemon client: echo going in cd ./client; make client clean: cd ./daemon ; make clean cd ./client ; make clean[/CODE] But I'm having 2 problems: 1) Make ALWAYS tells me there's nothing to be done. …

Member Avatar for Crushyerbones
0
136
Member Avatar for cthoes

[QUOTE] fwrite writes only name from the structure emp and rest of them are written garbage value to the file. so it would be really great if any one of you can help me out[/QUOTE] [CODE] #include<stdio.h> #include<string.h> #include<stdlib.h> int main(){ FILE *fp; char another,choice,useme; struct emp { char name[40]; …

Member Avatar for gerard4143
0
271
Member Avatar for Pamilerin

Please I have a little problem with my project. It goes "A polynomial of degree n is represented as Pn(x)=A0 + a1x + a2x2 + … + anxn Where a0, a1, a2, a3 , … , an are constant coefficients. Evaluation of such polynomials may be important if Pn(x) is …

Member Avatar for tux4life
0
79
Member Avatar for gerard4143

One day while pondering about C I came up with this program. Can you predict what the answer will be? Now run it, were you right? filename.c [CODE] #include <stdio.h> #include <stdlib.h> int main(int argc, char**argv) { unsigned long *iptr = (unsigned long*)0;/*pointer equals 0*/ unsigned long ans = (unsigned …

Member Avatar for gerard4143
0
142
Member Avatar for leegeorg07

Hi, I am trying to make a sublime text plugin to compile C using a make file, unfortunately it is all in python and I cannot get things to work :( could you please give me advice on passing data to the g++ make command? Thanks in advance.

Member Avatar for vegaseat
0
103
Member Avatar for msr

Hello, Im using threads in a recent project. I would like to know whats the difference between: pthread_kill() and pthread_cancel() What are the effects of each one? Thank you!

Member Avatar for Vijikumar
0
3K
Member Avatar for vijayshree21

Hi every one, I m doing some work in fractal image compression, plz tell me how to convert a c code to matlab code

Member Avatar for NicAx64
0
5K
Member Avatar for idrissi

[B]Intro[/B] Hey all, hope you are doing great. I am going to have some fun by teach C#. what I am going exactly to do is, when ever I get a free time I will post something. most of my tutorial lessons will be based on topics for example: variables, …

Member Avatar for idrissi
-1
104
Member Avatar for iru

Gentlefolk, Totally new to the world of C C++, compilers and linkers. I am attempting to compile and build some demonstration application code which access BlueTooth devices. Have all the .C, .H files, also a .lib. Using the LCC c ide-compiler-linker, etc on Windows-32 Compile one module - no errors. …

Member Avatar for iru
0
277
Member Avatar for daveoffy

I have been working with popen to run iwlist and get essid from the output but that is making the code sloppy. Is there an API I could use instead to get SSID and other information? Iwlist is in the package wireless-tools in linux Thanks.

0
63
Member Avatar for lisedaton

hi all!!!! im trying to do strcmp to a char in a structure and and char* and im getting a msg error: dereferencing pointer to incomplete type.... can somebody explain me what is that and give me an idea how to resolve it? thanx in advanced!

Member Avatar for Narue
0
133
Member Avatar for daudiam

In undefined cases, anything can happen, the program can crash, or unexpected results be thrown up. What happens is up to the compiler. In unspecified cases, the Standard has deliberately not defined the exact behaviour of a few things so that the compiler is at liberty to do as it …

Member Avatar for Narue
0
169
Member Avatar for daudiam

[code=c] printf ("%d",EOF);[/code] This gives me -1 [code=c]scanf ("%d",&a);[/code] [code=c]printf ("%d",a) [/code] where a is int (as EOF is an int), this gives me some junk value [code=c]printf ("%d",getch());[/code] This gives me 26 I've always given the input as ctrl+z (that's right, na!) What's the correct value of EOF ?

Member Avatar for Narue
0
141
Member Avatar for yanseung

Hello, Please help me to resize BMP image to bigger and smaller. Actually I'm trying to build PC wallpaer image with some function. And changing wallpaper has no problem but I want to change any image to screen size. Since desktop screen has some infomation section, bmp image should resized …

Member Avatar for Excizted
0
455
Member Avatar for uzair ahmad

Hello, I have a problem of with game of life source code in C. I need a source code for game of life in C programming language Kindly send me a source code so that i can check my own source code.

Member Avatar for Ancient Dragon
-3
138
Member Avatar for xouy

Hello, I'm checkng whether a file has been modified or not in order to refresh the content... However, i need a couple improvements : - How do I test the return value of stat to tell if it failed ? - The returned errno numbers may change between glibc versions, …

Member Avatar for Salem
0
137
Member Avatar for rgpii

I am attempting to program a doubly linked list template. My program is setup with the class node defined in a header file,the list itself in a header file and finally the main in a separate cpp file which calls the list header. The list header calls the node header. …

Member Avatar for Agni
0
118
Member Avatar for johndoe444

Hi, I have this function to tokenize an input string: int tokenize(char input[], char* tokens[], char delimiter[]) {...} There are invocations of the function with different size of array. For instance, [CODE]char tokens[2][100]; tokenize(input, tokens, " "); char tokens1[3][10]; tokenize(tokens[0], tokens1, ":"); [/CODE]as you can see the token holder array …

Member Avatar for Dave Sinkula
0
115
Member Avatar for krishnampkkm

[CODE]int main() { printf("Enter 0 or 1 :"); scanf("%d",&i_choice); if ( i_choice ==0 ) for( ;i_count_1 < i_number;) {------- ------ } if (choice == 1) for( ;i <= i_number;) {------- ------ }[/CODE] Here I raed a user input ( 0 or 1) So as per i/p I've to change the …

Member Avatar for krishnampkkm
-2
135
Member Avatar for daudiam

I know that ++a is faster than a++ because a++ has to first store the previous value of a at some temporary location and then increment a and then return the saved value, whereas ++a simply increments a and returns the pointer to the incremented value. Since, both a++ and …

Member Avatar for nezachem
0
638
Member Avatar for moonw3ll

My question is: If i'm the customer, how can i edit the quantity shown on the overview so that i can afford to pay the totalprice(if i've ordered too much) and delete some on the overview if i want to delete it(really short on money). And if i'm the owner …

Member Avatar for moonw3ll
0
253
Member Avatar for daveoffy

I am working on getting a string into this function but there are already to many arguments. [CODE] char interface[10]; if (!(in = popen("iwlist %s scan","r"))) /*Need interface string here */ { /*to be added */ } [/CODE] I tried to add ",interface" after "r" but it said to many …

Member Avatar for daveoffy
0
161
Member Avatar for chiko987

Hello, i have a function that starts searching for all files that match the given file name and Recursively traverses itself into sub directories and does the same thing and when a file is found i should output its path starting from the first directory that was given to the …

Member Avatar for death_oclock
0
139
Member Avatar for Pamilerin

How can one make a program repeat a set of lines of code.like for example [CODE]printf("enter the value of x:"); scanf("%d",&x); for(i=0;i<1;i++){ value+= arr[i]*(x,i); printf("\n The value of the polynommial is %ld",value); }[/CODE] How can you make it repeat so that it continues to read x and give out values

Member Avatar for death_oclock
0
203
Member Avatar for johndoe444

Hi, I am trying to implement some distributed algorithm (minimum spanning tree) where each node is represented by a process running in a different machine. Each edge represented by a client server communication channel. Suppose host0 is connected to host1, host2 and host5. I create 1 server sockets in each …

Member Avatar for nezachem
0
180
Member Avatar for blue3hree

please answer me.show why my code does not loop and it repeats question number 1. [CODE] #include <stdio.h> #include <stdlib.h> #include <time.h> /*prints the ASCII art for "FAIL"*/ void ascii_fail(void) { printf(" /%c__%c /%c %c\n", 92,92,92,92); printf(" /:/ _/_ /::%c %c ___ \n", 92,92); printf(" /:/ /%c__%c /:/%c:%c %c /%c__%c\n", …

Member Avatar for zalezog
0
227
Member Avatar for babaidebnath

Hello guyz, Presently I am having a problem with printing in c#. I have a pre printed bill, and I need to print values into some specific points of that bill. Any suggestion ?

Member Avatar for MxDev
0
135
Member Avatar for jeffreyfenis

3. A taxi charges an amount of 25.00 pesos for the first 300 meters and a fix rate of 15.00 pesos for every 200 meters thereafter. Any distance covering the next 200 meters zone (or less) is still charged 15.00. Create a program that would input the DISTANCE in kilometers …

Member Avatar for Ancient Dragon
-2
91
Member Avatar for naiyer.hoda

when i am writing c program in turboC i encounter error as "unable to create exe file". how to trouble shoot this and why i got this error.

Member Avatar for Ancient Dragon
0
25
Member Avatar for sunshine24

Hi This my first c programme.It asks 5 objective questions and displays the result at the end. [B]But when i compile it and run, it asks only for variables A,C and E .It doesn't ask for the inputs to question no. 2 and 4.It only displays these questions and skip …

Member Avatar for sunshine24
0
163
Member Avatar for ShortYute

I am trying to search a file (I have searched the forums and have found some treads but they do not really help me to do what I want) directly using fseek and strcmp but its buggy and gives off by one errors and such. The reason I did not …

Member Avatar for WaltP
0
129
Member Avatar for johndoe444

Hi, Is there a way to set stderr such that it does not print on screen rather on file. I have spawned a couple of threads and they are dumping all the error messages on the screen like a maniac and giving me a headache. Some help would be highly …

Member Avatar for WaltP
0
79
Member Avatar for regist1

Hello. Could anyone tell me how to convert [B]roman[/B] numbers to [B]decimal[/B] numbers. Can anyone provide some example for it? Thanks a lot. regist1

Member Avatar for tux4life
-1
213
Member Avatar for agilson

[Not sure how else I would describe the subject, that pretty well sums it up] Here's the set-up: I have a C# project that references variables in another application: [CODE]TextFrame BodyCopyBox = (TextFrame)doc.FindElement("BodyCopyBox");[/CODE] But what can happen is that I can have many of those like: [CODE]TextFrame BodyCopyBox1 = (TextFrame)doc.FindElement("BodyCopyBox1"); …

Member Avatar for agilson
0
111
Member Avatar for FX2236

Hi IM trying to make a queue of Byte[] every time i click on a button , Very Strait Foreword [CODE]System.Collections.Queue Myqueue= new System.Collections.Queue(20); public byte[] Bytearray = new byte[2]; Myqueue.Clear(); while (Myqueue .Count !=20) { Temp=Calc(Bytearray); Bytearray[0] = temp[8]; Bytearray[1] = temp[13]; Myqueue.Enqueue(Bytearray); }[/CODE] So the Loop is done …

Member Avatar for sknake
0
202
Member Avatar for kwixbit

Greetings. I need help making a dynamic array with 3 columns, the problem is that i don't know at run-time how many rows there must be allocated. So i need to allocate one row every time. I have this as code: [CODE] gchar ***servers_array = NULL; servers_array = realloc(servers_array, (detected_netstat_servers …

Member Avatar for Narue
0
169
Member Avatar for Iam3R

i am writting a program for finding the no of keyword ( occurances ) and operators occurances. i am taking the all the keywords in an array and all the operators in seperate arrays for each category of operators. char *kw[] = {"auto","break"..."while" }; char *Arth_op[] = { "%","*","+","-","/"}; according …

Member Avatar for Narue
0
83
Member Avatar for Iam3R

Hi, i have a doubt regarding conditional macros and undef directive. can i use undef for a function like - macro, by just specifying the name of the macro with out specifying the argument list as written in line 8. is the code correct with out these statements: [ICODE] #define …

Member Avatar for Narue
0
112
Member Avatar for DotA

My below code will compile and create a form with blue inside. I'm currently trying to draw a triangle to the screen but when I call "device.DrawPrimitives(PrimitiveType.TriangleList, 0, 1);" inside of my render function the program fails. Let me know if I'm doing anything wrong, I'm still in the process …

Member Avatar for DotA
0
261
Member Avatar for JaiChand2

Please help with the following code,,, It is compiling though but During run its stating that [B]"Your code has stopped its execution with a non-zero (failure) exit value.This is generally due to run time Exceptions like Memory Access Violation and Floating Point Exception. Please check your code for run time …

Member Avatar for nezachem
-2
97
Member Avatar for anatz

hi,.im a first year student taking information technology, never mind where i am studying.,,,i just want to ask some tips to understand easily turbo c.,.

Member Avatar for gerard4143
0
76
Member Avatar for kelevra

Hi all... First post here, be gentle. I'm trying to get this to work, and there's no output. This is from the K&R book [v2] exercise 1-14, the prompt is in the header. I added comments for readability, and please comment on anything you believe needs improvement. Thank you for …

Member Avatar for jonsca
0
124
Member Avatar for moomeen

hello everyone .. im writting a C program that requires to insert integers from a text file .. the contents of the text file are: 1:2:4 4:12:5 13:7:5 1:20:4 how can i read each number and define it as an integer ???? please HELP !! [CODE] #include <stdio.h> int main() …

Member Avatar for mrnutty
0
82
Member Avatar for Eko

I have one or more functions separate from main() , that besides the return value , must also return the time it tooked to process. How can I do that ?

Member Avatar for motogeeeksatyam
0
124
Member Avatar for maqsood8797

BIQ-005-Accelerator You’ve been given an assorted set of gears. Each gear has a different number of teeth – the notches on a gear that interlock with notches on another gear to transmit speed. You have a couple of belts one coupled to an input and the other for the output. …

Member Avatar for ShortYute
-4
154
Member Avatar for marirs07

is it possible in c program to run two processes at the same time.For example i want to run a timer along with my application .The timer must be shown on the screen.Thanks in advance

Member Avatar for gerard4143
0
91
Member Avatar for jp071

Hello, When i run my program it shows just segmentation fault. As my knowledge, segmentation fault can occur for pointer and memory related fault. But i could not find out my mistake. Please see some part of code(maybe, that is related to segmentation fault): [CODE] char *state_in; //state_in = malloc(1024); …

Member Avatar for jp071
0
251
Member Avatar for uzair ahmad

Hello: My problem is: "The game of Life takes place on a 2d array of cells, each of which may contain an organism. Let occ(i) be the no. of cells adjacent to cell i that are occupied by an organism is obtained from the previous generation appling the following rules: …

Member Avatar for tux4life
-4
128
Member Avatar for blue3hree

hi! i'm new here in daniweb.so pardon me for disturbing you all.lol i would like to present you a little problem. i want to design a program that will generate wnted number of arithmetic statements and it would be answered by the one who will use it. and at the …

Member Avatar for ShortYute
0
85

The End.