15,552 Topics

Member Avatar for
Member Avatar for Hyperion101

Hey guys, I had to make a basketball score board, and I've run into some errors. Here's my code so far: #include <stdio.h> #include "genlib.h" #include "simpio.h" #include "strlib.h" main() { int t, tw, tp, r, rw, rp, j, jw, jp, f, fw, fp; printf("How many games did the Tigers …

Member Avatar for HiHe
0
380
Member Avatar for nitin1

Is there any alternative for clrscr() and gotoxy in gcc ? I am using system("cls"); to clear screen but it doesn't identify cls as a valid command whereas in cmd cls is working perfectly on windows? can anyone please help ? i am using gcc as my compiler and using …

Member Avatar for deceptikon
0
1K
Member Avatar for kanagamani

swap of two variables using temporary variable execute first or without using temporary variable execute first?

Member Avatar for vegaseat
-1
124
Member Avatar for sparkthesunoff

I have two different text files, one of them contains a text, the other one works as a dictionary. The dictionary has some words line by line with their description beside them separated by a comma. I'm supposed to search for all these words in the text and then replace …

Member Avatar for Ancient Dragon
0
312
Member Avatar for karma2you

Hello,i want my my program to look just like the one below the line: But i keep getting the same issue of the void Instructions() coming before the Instruction; input (( i want it the other way around)) For example i keep getting(after compile): I have a capital letter in …

Member Avatar for Ancient Dragon
0
169
Member Avatar for emaellie

Hi ya guys, I have been learning about forks and processes, below is my code that i have created but am having difficulty on certain things. **1. Add code to print out and note the values of :** i. The values held within the array fd[ ] from the parent …

0
122
Member Avatar for Thundermax

Is there any function like TrimStart C# in C? (delete the first apparition of space in a string) or some way to use it in C?

Member Avatar for Ancient Dragon
0
64
Member Avatar for rock123

im trying to create a uno valid deck...i dont even know were to start and im a beginner.

Member Avatar for Moschops
0
56
Member Avatar for yasaswyg

How do I compile a c program in Visual C++ 2008 express edition? I tried finding a compile button but i couldnt find it

Member Avatar for asabjork88
0
368
Member Avatar for Thundermax
Member Avatar for karma2you

this is the assignment I need some help with.I have posted what i have written so far for this assignment and am not sure what steps to take next, or if i have properly coded so far. I'm trying to get my program to work but it won't compile i …

Member Avatar for Adak
0
822
Member Avatar for jain_1
Member Avatar for Jalaishaa

When I type the following code, I dont get the required output and I fail to understand why. Problem: Write a program to find the product of all the positive even numbers less than or equal to 30. Possible solution according to me: #include <stdio.h> void main(void) { int n, …

Member Avatar for Jalaishaa
0
179
Member Avatar for drieran

I need to calculate the used bandwidth in a bus. All packets can be read for any client in the bus, then if I'm a only listener I can catch all packets and know how many bytes are moving in the bus. Then my first approach to calculate the used …

Member Avatar for drieran
0
121
Member Avatar for Thundermax

Hello guys, is there any function to search for a word within a string and replace it with another? (Of different sizes) example: 1 string [] = "bla ble ble ble bli blo" word to replace = bli by 123456 2 string [] = "bla ble ble ble 123456 blo"

Member Avatar for Ancient Dragon
0
225
Member Avatar for sneha_

[CODE]//To convert postfix expression into an expression tree #include"stdio.h" #include"conio.h" #include"process.h" #include"string.h" #include"stdlib.h" struct node{ char item; struct node *lnode; struct node *rnode; }*stc[30],*temp,*root; typedef struct node *NODEPTR; char expression[50]; char c; int top=0; NODEPTR pop(); void push(NODEPTR); void getinput(); void inorder(NODEPTR p); int main (){ getinput(); int i,j; for(i=0;i<strlen(expression);i++) …

Member Avatar for deceptikon
0
2K
Member Avatar for Nicholas_1

I'm trying to write a text based game using C. To do this the way I want, I need to include a save system that will output all of the necessary variable values to external files, then be able to load the values fro those files later. Any advice?

Member Avatar for Nicholas_1
0
177
Member Avatar for maralbt
Member Avatar for Ancient Dragon
-1
210
Member Avatar for Thundermax

Hello guys, how can I make the first character of a string is stored in a char? example: char [20]: "hello"; char c: h;

Member Avatar for mridul.ahuja
0
152
Member Avatar for faysal.ishtiaq_1

I want to write a program that will take an input,determine it whether it is integer array or string. and then we will be abble to insert an elwment giving two parameters. 1. element, 2. position. I have done, given bellow but can't finish it. Is there anyone for me …

Member Avatar for Adak
0
157
Member Avatar for exfoxs28

why the result is always the same? #include<iostream.h> #include<conio.h> #include<time.h> #include<dos.h> #include<stdlib.h> int main() { int a,b,c; clrscr(); a = 5; b = 5; c = 5; for(int x=1; x<=24; x++) { gotoxy(5,x); cout << "*"; gotoxy(70,x); cout << "*"; delay(50); } clrscr(); do { for(int x=1; x<=24; x++) { …

Member Avatar for exfoxs28
0
236
Member Avatar for duplexcom

Dear, I'm trying write a simple C program that h two input files. Both are large files. First file has one column and second file has two columns. Just compare the first colums of both files and print the whole line of second file that matches first one. File2.txt 123456 …

Member Avatar for vinod.hambram
0
268
Member Avatar for toniann.midori

Cant figure out whats wrong with this function but i think its probably a data type error. Please help! void displayName(){ char name[30]; int number, x; printf("So..what is your name?\n"); scanf_s("%s",&name); printf("Nice to meet you %s, how many times would you like to be cloned?\n",name); scanf_s("%i", &number); for(x=0; x<number; x++){ …

Member Avatar for cmps
0
120
Member Avatar for shahab.burki_1

I am having an interesting problem in scanf. It inputs the integers successfully but overlooks the character. In debugging I saw a strange value placed in the character variable. Kindly help me-- #include <stdio.h> int main() { int a,b; char op; printf("Welcome To Command Based Calculator"); // printf("\n"); printf("Now enter …

Member Avatar for <Anurag>
0
655
Member Avatar for CProgrammmmer

How do I make a program to convert Octadecimal value to Decimal, Hexadecimal to Binary and Hexadecimal to Octadecimal. Please help meee! T.T

Member Avatar for Assembly Guy
0
125
Member Avatar for nitish.mohiputlall

here is the question: Write a program that accepts a positive integer. Use a function to calculate the factorial of that number. my codes: #include <stdio.h> #include <stdlib.h> int fun(int z); int main() { int n,x,fact; printf("enter a number: "); scanf("%d",&n); fact=fun(n); printf("factorial of %d is %ld\n" ,n,fact); system("pause"); return(0); …

Member Avatar for Assembly Guy
0
167
Member Avatar for dev90

I am getting garbage value. Is it need to free 's' every time or the reason is something else. please,help. #include<stdio.h> #include<conio.h> #include<alloc.h> char* toBin(int); void rec(int); void main() { int n; char *out; clrscr(); printf("\n Enter no : "); scanf("%d",&n); out=toBin(n); printf("\n %s",out); free(out); // rec(5); getch(); } /*void …

Member Avatar for dev90
0
261
Member Avatar for Tinnin

Hi all, I'm running through the book "The C Programming Language" by *Kernighan & Ritchie* and I'm having some trouble with one of the exercises. "Write a program to determine the ranges of char, int, short and long variables, both signed and unsigned, by printing appropriate values from standard headers …

Member Avatar for Ancient Dragon
0
193
Member Avatar for satnav_8

Here is what I'm trying to do: * Take input with scanf() * Pass input to function * Beep frequency associated with input I have notes defined, e.g `const in C5 = 523.25;` I want the user to be able to input "C5", and have the computer beep at a …

Member Avatar for Ancient Dragon
0
389
Member Avatar for infatuate

Hey guys I'm having trouble declaring a header file so I can use multiple modules. I have files named main.c foo.h and in main.c I have a <#include foo.h> but it says that it can't find the foo.h file. Why?

Member Avatar for Ancient Dragon
0
257

The End.