15,551 Topics
| |
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 … | |
swap of two variables using temporary variable execute first or without using temporary variable execute first? | |
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 … | |
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 … | |
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 … | |
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? | |
im trying to create a uno valid deck...i dont even know were to start and im a beginner. | |
How do I compile a c program in Visual C++ 2008 express edition? I tried finding a compile button but i couldnt find it | |
Just one question, how to add space end of string? | |
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 … | |
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, … | |
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 … | |
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" | |
[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++) … | |
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? | |
turbo c find arithmetic progression term a,a+b,..., a+(n+1)d plizzz help mee((I don`t know C(( | |
Hello guys, how can I make the first character of a string is stored in a char? example: char [20]: "hello"; char c: h; | |
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 … | |
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++) { … | |
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 … | |
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++){ … | |
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 … | |
How do I make a program to convert Octadecimal value to Decimal, Hexadecimal to Binary and Hexadecimal to Octadecimal. Please help meee! T.T | |
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); … | |
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 … | |
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 … | |
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 … | |
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? | |
I have made a program for hotel management. It has a problem that: In the Accounts function, it should reset all the flags of the registered members through the program. But there is a error that it does NOT. I have spent a lot of months, trying to debug this … |
The End.