15,552 Topics

Member Avatar for
Member Avatar for sridhar.selva

hi, i m doing a program now. in which i need to get ascii values like SOH, NUL etc from the serial port. i m getting the values as string. i don know how to process the ascii values to obtain the original values back. example my data is SOH …

Member Avatar for sridhar.selva
0
238
Member Avatar for akaicewolf

Ok so I am working on a hash map but I ran into trouble with reading in the input. I need to be able to read in the input from a file if specified if not from the console. Thats not a problem but when it comes to reading it …

Member Avatar for VernonDozier
0
553
Member Avatar for xushi

Hi, I'm supposed to write a code of finding the shortest path of VRP... Assume that shortest path = shortest time. "Given a set of locations and a set of homogenous vehicles, find the minimum time of tour that visits each city exactly once by any of the given vehicle. …

Member Avatar for xushi
0
153
Member Avatar for linkingeek

Could you please tell pictorially difference bw these 2 codes(o/p is same) and suggest any source where i can once in for all resolve doubts in pointer to pointer problems except "K&R in ANSI C" [CODE]#include <stdio.h> #include <string.h> void pointer(char**); void main() { char *p[]={"name","fame","claim"}; pointer(p); } void pointer(char …

Member Avatar for versan
0
159
Member Avatar for ahp@aol.in

Hi folks, I need a solution for following scenario. 1. Suppose two processes running simulteneously. 2. Process (P1) has already locked a mutex (M1). 3. Process (P2) is trying to lock same mutex (M1) but as it is already locked by (P1), P2 is waiting for unlocking (M1). 4. Now …

Member Avatar for ahp@aol.in
0
182
Member Avatar for cali_kid

i am trying to write a program that will prompt the user to enter test scores terminated by a negative number. and then find the min max and average of the scores inputted. i have gotten everything to work except the average. the assignment says i can only use variables …

Member Avatar for cali_kid
0
148
Member Avatar for yamatoC

Hi, I'm having some very hard time with my header files when working with linked lists. I'm not too sure what I need to define in them except for the prototype functions. The way to create strucs within the header files confuse me. This first file is the header for …

Member Avatar for yamatoC
0
637
Member Avatar for hust921

I am trying to make an encrypter, but as you can see, it's not working. str[] have an undeclared array size, i know that theres an option to make it with a pointer array, but i really want to make it a fixed size, also, so i can skip the …

Member Avatar for hust921
0
297
Member Avatar for PIXXAR

IM HAVING PROBLEM WITH THIS PROGRAM, GOING BACK TO THE MAIN PAGE AND SELECTED PAGE, IF THE USER ANSWER NO, THE PROGRAM WILL GO BACK TO MAIN MENU IF THE USER ANSWER YES, THE PROGRAM WILL COMPUTE THE SAME PROBLEM. help PLS... THE PROGRAM BELOW WONT GO BACK TO COMPUTE …

Member Avatar for PIXXAR
0
999
Member Avatar for nezhad

Hello; I have 2 questions: 1- I know you can allocate memory to an array dinamically in C and C++. But, can this be done if the array is part of a structure? 2- Can the size of a dynamic array automatically grow up to a maximum or do you …

Member Avatar for nataraja833
0
572
Member Avatar for abed1986

Hello everyone, I have a program that intends to create a doubly linked list of structures, using the following header (q1.h): [CODE=c]typedef struct lNode* ListNodePtr; typedef struct lNode { char* string; ListNodePtr next; ListNodePtr prev; } ListNode; [/CODE] This is my implementation: [CODE=c]#include "q1.h" #include <stdio.h> #include <stdlib.h> #include <string.h> …

Member Avatar for abed1986
0
812
Member Avatar for dineshswamy

i did a simple bubble sort but it is ot working . help me out. [CODE] #include<stdio.h> main() { int i,j,k; int a[]={7,9,4,2,3,6}; for(i=0;i<7;i++) for(j=i+1;j<7;j++) if(a[j]<a[j-1]) { k=a[j]; a[j]=a[j-1]; a[j-1]=k; } for(i=0;i<7;i++) printf("a[%d]==>%d",i,a[i]); } [/CODE]

Member Avatar for dineshswamy
0
107
Member Avatar for djextazy

As this is my first post on this forum I want to say "Hello!" to everybody and I hope that we'll help each other as much as we can and we'll be very good friends. :) So, this is my problem ( a rather simple one but I don't know …

Member Avatar for hust921
0
201
Member Avatar for sridhar.selva

hi can u ppl help me on this. can i use multiple enums in a single c program, if so is there any constrain on it? [CODE]enum pattern1 {red, green, yellow} pt1; enum pattern2 {orange, blue, black} p2; enum pattern3 {white, grey, violet} p3;[/CODE] is this possible????

Member Avatar for sridhar.selva
0
164
Member Avatar for outout1234

I want my program to just continue as long as the user press any key How do we do it with only use of scanf?? for example: int main(void) { while(1) /*my program goes here*/ printf("Hit any keys to continues......"); scanf // how? }

Member Avatar for Arch Stanton
0
175
Member Avatar for ahspats

i have to write a program, in which i have to make pointer to point to the character, where it last occured in a string. For example: String: Lord of the rings Character: r Pointer points to the last 'r' in the string, that is in the word 'rings'. If …

Member Avatar for yasin.uohyd
0
212
Member Avatar for shaker naser

I want to Write a program that determines the day number (1 to 336) in a year for a date that is provided as input data. As an example, January 1, 1994, is day 1. December 31, 1993, is day 365. December 31, 1996, is day 336, since 1996 is …

Member Avatar for thines01
0
318
Member Avatar for foreshadowed

Greetings all; what I'm trying to do is create an array of structs dynamically by using functions for allocation, display, and then freeing memory. I'm *able* to do the process if it's within scope of the foo declaration, but the initFoo function throws an exception. I *think* it's the order …

Member Avatar for MonsieurPointer
0
147
Member Avatar for yamigx

hi guys .. i have an assignment .. and i didn`t now that i have to do it by tomorrow and now i have no time .. i will be thankful if you can help me.. "Write a program that determines the day number (1 to 336) in a year …

Member Avatar for zeroliken
0
298
Member Avatar for theCompiler

how can i convert this into a struct? the program is prnting all the even nos [CODE]void main() { int num[5],even[5],count,j=0; clrscr(); printf("Enter 5 numbers\n"); for(count=0;count<5;count++) { scanf("%d",&num[count]); } for(count=0;count<5;count++) { if((num[count]%2)==0) { even[j]=num[count]; j++; } } printf("EVEN:\n"); for(count=0;count<j;count++) { printf("%d\t",even[count]); } getch(); }[/CODE]

Member Avatar for zeroliken
0
101
Member Avatar for jdm

I'm working on a tcp server and client for linux. I want the tcp server to send a 10MB file to it on request and I want the client to save it to local disk. I would appreciate any help on it. Thanks for the help. jdm server: [CODE] /* …

Member Avatar for gerard4143
0
260
Member Avatar for sreevisakh2007

[CODE] unsigned int *a; a = (int*)malloc(1*sizeof(int)); a[0] = 10; a[1] = 20; a[100] = 40; printf("%u",a[100]); [/CODE] I have created a pointer named a and allocated 'single' int space for it but still i can store and retrieve more than that. This code runs. Then what is the need …

Member Avatar for Ancient Dragon
0
152
Member Avatar for python_adz

hello everybody, please help me in solving the problem of finding the XOR value of 4 bits as i require it in my project. i tried ^ sign, but it doesnt work for four variables? kindly help

Member Avatar for L7Sqr
0
104
Member Avatar for Massa3332

Hello everyone, I've been having a problem with some of my scanf() functions being skipped after I input a string with a space in between (e.g Jack Daniels). I've been trying to fix it, but it has been driving me crazy. [CODE]#include <stdio.h> #include <stdlib.h> struct Student { int studentNumber; …

Member Avatar for Arch Stanton
0
207
Member Avatar for angelineang

i got no idea how to correct the error,can help me? this is a chem quiz that contain 20 question but i need to random everytime 10 question,other than this,also have a calculator,& mini games [CODE]#include<stdio.h> #include<math.h> #include<stdlib.h> #include<time.h> #include<windows.h> int main (void) { int option,question,i,count,z=0; char choice,game,quit; int selection; …

Member Avatar for Ab000dy_85
0
287
Member Avatar for Dr_Freeman

Greetings. I'm currently implementing small ANN on my microcontroller. I need to calculate sigmoid activation function. The problem is that I cannot use standard c libraries like math.h so I need custom written pow function. This is how it will be used:pow(e,-(someFloat)); Did anyone have already implemented something similar ?

Member Avatar for histrungalot
0
621
Member Avatar for Ribamar23

hi when i try to use atof i get different values every time i run my app code: [CODE]#include <stdio.h> #include <string.h> #include <math.h> int main(int argc, char **argv){ char* a = "100"; double b = atof(a); printf("%f", b); }[/CODE] why do i get different results everytime i run my …

Member Avatar for WaltP
0
84
Member Avatar for johnnydarten

Dear all, I'm a C beginner and I was doing a small practice nested loop on C when I got a very strange error which when the console opens tells me that my program has stopped working. here is the code: [CODE] #include <stdio.h> #include <stdlib.h> #include <math.h> #include <string.h> …

Member Avatar for johnnydarten
0
170
Member Avatar for DarkMonarch

is it possible in C to do an unfix size array like in Java ? if so, howto ? thx guys Dark

Member Avatar for DarkMonarch
0
184
Member Avatar for Kycas

Hi, I want to filter .BMP image with 3x3 digit matrix. Basicly it is multiplying image pixels by numbers in matrix. Any suggestions how it should be done? I know that i have to open a file using fopen() I did that. Should I just loop through whole image and …

Member Avatar for Kycas
0
76

The End.