15,551 Topics
| |
This is really making mad. I'm trying to add two numbers. This is a basic code that I can't get to compile. [CODE]#include <stdio.h> #include <stdlib.h> extern int addus(int,int); int main() { int a; int b; int result; a=5; b=6; result = addus(a,b); printf("Your value is: %d", result); return EXIT_SUCCESS; … | |
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 … | |
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 … | |
[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; … | |
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*) … | |
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 … | |
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 … | |
| 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 == … |
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 && … | |
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 … | |
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: … | |
/* 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++) … | |
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. | |
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 … | |
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 … | |
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 ( … | |
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. | |
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 … | |
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 … | |
So here's the problem: A function that will display all the vowels from the string. PLease help me | |
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] … | |
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 … | |
[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 … | |
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 … | |
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 … | |
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 … | |
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(); … | |
hello guys... pls help me in this.... i m new to this language...C help me ! | |
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] | |
[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 … |
The End.