15,550 Topics

Member Avatar for
Member Avatar for cdudefire

I have been ok so far but now I am having a problem with counting the amount of time that cars spend in the lot during the day and counting the total cost at the end of the day. Any pointers in the right direction would be helpful. Here are …

Member Avatar for cdudefire
0
452
Member Avatar for minimi

I'm writing a reverse Polish calculator. If the input is 1 2 - 4 5 + *, the output should be 9, but I'm getting -9. Does anyone see where the problem lies? Thanks! [CODE]#include <stdio.h> #include <stdlib.h> // for atof() #include <ctype.h> /* denifitions for main() */ #define MAXOP …

Member Avatar for WaltP
0
257
Member Avatar for neeraj goswami

[CODE]//ASSIGNMENT NO- 4 //EMPLOYEE DATABASE #include<stdio.h> #include<conio.h> //STRUCTURE DEFINATION struct emp1 { int id; int dflag; char name[10]; float salary; }; int main() { //INITIALISATION struct emp1 e[20]={0,0,"\0",0.0}; int accept(struct emp1 [],int); int display(struct emp1 [],int); int append(struct emp1 [],int); int delete1(struct emp1 [],int,int); int modify(struct emp1 [],int,int); int no=0,v=0,u=0,ch=0,count=0; …

Member Avatar for N1GHTS
0
155
Member Avatar for sunny124

I tried using (*game_data.blocks), (game_data.*blocks), (game_data.blocks) but none of them work. I'm getting a error msg: 'cannot convert sprites* to sprite_data** in assignment' ----------------------------------------------------------- [CODE] typedef struct{ //sprite _sprites[]; sprite *blocks; sprite ball; sprite paddle; int numb_brick_sprites; }sprites; [/CODE] ----------populate_bricks procedure------------- [CODE] void populate_bricks(sprites &game_data){ game_data.numb_brick_sprites++; sprites *temp_ = (sprites*) …

Member Avatar for sunny124
0
133
Member Avatar for NerdyChick27

I'm working on an assignment and now that I've finished I'm supossed to write a tester file to demonstrate how well the program works. While writing it I was just testing in a main file within the library itself. Now I'm getting an invalid pointer error when I try to …

Member Avatar for NerdyChick27
0
260
Member Avatar for thetwig

hey guys.. I'm trying to create a bunch of children where the parent creates child1, and child1 creates child2 and the parent creates child3 using fork()... and I'm supposed to pass a message through using a pipe, but when I pass from child2 to child3 I have to use a …

0
127
Member Avatar for muaazab

I am trying to call the fork() system call. It works quite fine until I don't use printf method in the code. My code is as follows. Platform: Linux Language: Pure C [CODE] #include <sys/types.h> #include <unistd.h> #include <stdio.h> pid_t fork(void) main() { int pid; pid = fork(); if(pid == …

Member Avatar for muaazab
0
89
Member Avatar for rocketman03

hey im trying to create a program to convert dec to hex , but this only lets me print either integers or chars , but not both , how do i fix that ? [code] int convertHex(int num) { quotient=(num / 16); remainder=(num % 16); if (remainder <= 9 && …

Member Avatar for WaltP
1
418
Member Avatar for Benifited

Hey all im new to the site and looking around i can tell i came to the rite place. Now for my question. Im suppose to take a poem with punctuations and blank lines in it and reprint the poem one word per line. The reprint cant have punctuations or …

Member Avatar for Lordvivi
0
202
Member Avatar for Zeref

Hi guys, I'm having trouble with this particular code [code=c] #include <stdio.h> int main() { char aChar; printf("Please enter a character: "); scanf("%c",&aChar); while (aChar!='x') { printf("The Letter is %c\n", aChar); printf("Please Enter another character: "); scanf("%c", &aChar); } return 0; } [/code] The output is: Please enter a character: …

Member Avatar for Narue
0
212
Member Avatar for dev90

/* can any 1 tell me wats the problem."[COLOR="Red"]Que: reverse an array without using temporary array[/COLOR] " [COLOR="Green"]This works for N =5 but when N =6 it displays the original values of an array.[/COLOR] */ [CODE]#include <stdio.h> #include <conio.h> #define N 6 void print(int b[N]) { int i; printf("\n"); for(i=0;i<N;i++) …

Member Avatar for Narue
0
3K
Member Avatar for reojavier

honestly i was new to C and i just need a codes for finding the mean for grouped data. i hope this site can least help me. you have my thanks.

Member Avatar for reojavier
-1
919
Member Avatar for marirs07

Hi all, How to find the offset of a structure member just by knowing the structure name and the address of that member????? For ex. [CODE]Struct cook { int a; int b; char c; }eat; void func(int *ptr) { //how to find the base address of structure. //I know only …

Member Avatar for Narue
0
158
Member Avatar for functionalCode

Hey everyone one I have some code and I need to change the address to the function I want to go to. I need to change the address of normal in the menufunc array to administrative. I have constructed this string that puts me in menufunc[2]: xxxxxxxxxxxxxxxxxxxx111111111122222222223333333333444444444455555555556680487d2 The address of …

Member Avatar for Narue
0
140
Member Avatar for deepmala8

Hi, I am also stuck with a problem in writing into the file .below explanation also helped me but my issue is yet not solved .I want to edit my file which looks like IG_UDP_CPORTS="22,5060,5062" TG_TCP_CPORTS="1,2,3" EG_TCP_CPORTS="50,2" IG_TCPP_CPORTS="60,62 IG_UDP_CPORTS="5060,5062" I want to delete any value written in first line ( …

Member Avatar for Ancient Dragon
0
893
Member Avatar for niyasc

Can anyone tell me the logic to solve common emitter biasing of a BJT using c programming language? Just tell me the idea. No need of program.

Member Avatar for N1GHTS
0
122
Member Avatar for mx tommy

Hi! I'm trying to learn some C in order to make some changes to some existing programs that are written in C. For what it's worth all my experience to date has been with PHP, so this is quite different for me. Basically, I want to have an array, (patterns …

Member Avatar for mx tommy
0
222
Member Avatar for deva89

Actually i am trying to create some patterns using loop like pascal's triangle etc. But the concept of loop is still not very clear to me as i am learning c language myself without any professional help. would anyone please elaborate me with the help of an example and explain …

Member Avatar for NP-complete
0
162
Member Avatar for Tenjune

So here's the problem: A function that will display all the vowels from the string. PLease help me

Member Avatar for N1GHTS
0
74
Member Avatar for FinaL111

I'm having trouble wrapping my brain around this concept. I have taken two java classes before so this is my first C class. My question is about a portion of my assignment. Basically the assignment is it reads in data about a word search in the format like so: [url]http://pastie.org/2582599[/url] …

Member Avatar for FinaL111
0
266
Member Avatar for minimi

My program compiles and runs, but does not print any output. It is supposed to read the text file and output lines that contain the pattern (which this in case is Bob - so it should print Bobby, Bobbie, etc if those names are in the text file).. This is …

Member Avatar for minimi
0
243
Member Avatar for tayler

[CODE]#include<stdio.h> #include<conio.h> #include<dos.h> main() { int a,b,c,number; clrscr(); int ad() { clrscr(); printf("Enter first number"); scanf("%d",&a); printf("Enter second number"); scanf("%d",&b); c=a+b; printf("The answer is %d",c); } int sub() { clrscr(); printf("Enter first number"); scanf("%d",&a); printf("Enter second number"); scanf("%d",&b); c=a-b; printf("The answer is %d",c); } int mult() { clrscr(); printf("Enter first …

Member Avatar for hszforu
0
146
Member Avatar for functionalCode

Hey everyone: Can someone tell me why when I called printf in main I get a blank character. I ran this code in a C interpreter and it works fine, but when I compile with gcc and run it, it doesn't print out the new string. I get a empty …

Member Avatar for NP-complete
0
100
Member Avatar for cdudefire

For a class in C programming I have been asked to create a dice game. Here are the requirements. A player rolls two dice. Each die has six faces. These faces contain 1,2,3,4,5, and 6 spots. After the dice have come to rest, the sum of the spots on the …

Member Avatar for cdudefire
0
2K
Member Avatar for effizy

First off, this is my first c program and i am by no means a programmer so ignore me if i don't meet your standard and let those willing to show me how it is done respond. Problem Statement: I am trying to use "strtok" to tokenize the strings in …

Member Avatar for Ancient Dragon
0
5K
Member Avatar for vedro-compota

hi , guys/ I again have problem with C understanding. Please help . there's code = [CODE]/* */ #include <stdio.h> #include <stdlib.h> #include <limits.h> main() { char* inputstr; inputstr = simple_readline( "Please specify the input string (one more notification))" , 0); printf("\n You've specified string = %s\n", inputstr); getchar(); getchar(); …

Member Avatar for vedro-compota
0
236
Member Avatar for gauravrishi
Member Avatar for geeksforgeek

Help.....!! Please explain me the output of the following code.I am unable to understand why infinte loop is occuring for i>126. [CODE] #include<stdio.h> int main(void) { char i=2; while(i<=127) { printf("%d\n",i); i+=1; } return 0; } [/CODE]

Member Avatar for Narue
0
101
Member Avatar for kaleam

[CODE]#include<stdio.h> #include<conio.h> #define m 5 void main() { int sal[m],cl[m],i=0,j; int a1=0,a2=0,b1=0,b2=0,split; float gi[m]; clrscr(); printf("\nEnter salary and class for 5 people,Class '1'for risk,'0'for no risk:"); for(;i<m;i++) { printf("\nEnter Salary:"); scanf("%d",&sal[i]); printf("\nEnter Class:"); scanf("%d",&cl[i]); } for(;i<m;i++) { split=sal[i]; for(j=0;j<m;j++) { if(sal[j]<=split && cl[j]==1) a1++; else if(sal[j]<=split && cl[j]==0) b1++; else …

Member Avatar for gerard4143
0
86
Member Avatar for CoolAtt

hi . can someone plz explain how to do regex in C. input: a text file. aim: read each line from the text & check if a RegEx pattern exists. finally return that pattern if it exists. plz share any algo or code snippets if u have.thx.

Member Avatar for rubberman
0
232

The End.