15,552 Topics
| |
hi guys,i was trying to make user able to make selection again when they make an invalid input, but when i run this code,it just doesnt work that way,it goes printing the same line like crazy...did i do something wrong? [CODE] int main (void) { //Local Declarations int menu; //Statements … | |
While it is true that the inorder traversal of a binary search tree produces a sorted output, is the converse also true, i.e., if the inorder traversal of a binary tree is sorted, then is it necessarily a binary search tree? | |
[CODE]#include<stdio.h> #include<conio.h> void main(){ char x; int result,a,b; printf("type the first number\n"); scanf("%d",&a); printf("enter the operand\n"); scanf("%d",&x); printf("type the second number\n"); scanf("%d",&b); switch(x){ case '+': result=a+b; printf("value is:%d",result); break; case '-': result=a-b; printf("value is:%d",result); break; case '*': result=a*b; printf("value is:%d",result); break; case '/': result=a/b; printf("value is:%d",result); break; case '%': result=a%b; … | |
I'm writing a tcp server and client program in C on linux. It compiles and works under linux, but when I try to compile it using terminal under mac I get errors. If somebody knows why I would appreciate telling me. Any way I have most of the program done, … | |
This is my code: it works,but when the user answers correctly until question 7,the question 8, 9 , 10 will be skipped and goes to result instantly,can someone tell me whats wrong?i been looking it trhough for hours >.< thanks [CODE]void hangman (void) { int wrong =0; int answer; char … | |
hi guys,im trying to create a menu which allow user to select their choice. When a choice is selected, a function designed for that choice will be called. However,it seems that i cant use 'if else' to call them, is there anyway to solve it?im sure i did it wrongly...if … | |
Hey, I have a problem taking input from the terminal. I need to read an integer first, then a string. But when I press enter after entering the integer, the string doesn't take any input. Yes, I did try using a fflush(stdin) between the 2 inputs, still doesn't work. I … | |
[CODE]#include <stdio.h> #include <stdlib.h> #include <string.h> //typedef struct to define what's in the phonebook typedef struct PhoneBookContacts { char Name[20]; char Surname[20]; char PhoneNumber[20]; } phone; //Function prototypes void AddEntry (phone[]); void DeleteEntry (phone[]); void PrintEntry (phone[]); void Sort (phone[]); int counter = 0; //Global counter variable used to keep … | |
Hi Guys, I have an issue with my program. I am trying to implement bitonic sort parallel algorithm using MPI. The issue is like i am able to sort upto 1000000 array elements.. but, if i increase it to 10000000 or 100000000 the processors are not able to handle it. … | |
I am currently working on implementing an operating system in turbo c which uses c as the programming language. For this project we must implement pagination. I have absolutely no idea how to do this in c and most web results are for web pages using mySQL or java or … | |
I've to write a program which gets a colour from user.Users will enter the colour's name if the colours is exist in my string,program will give a msg.If it doesn't exist give an error msg and stop program.I've already write a code but it doesnt works accurately. [CODE]int i,j; void … | |
Hi I have an old inherited file with c code (visual studio 6). I compiled this file in Visual C++ 2010 (I made an empty project and a win32 console application) and was OK. But when I did the build to make the .exe then the linker throws errors. I … | |
hello friends, I am reading multidimensional arrays but i am not getting understand. anyone know please help me in detail. thanks, | |
create the bank account task using structure and Files concept in c. | |
Alright guys, I've been trying to think how to do this and I keep confusing myself. It's part of a project using piping in UNIX but first I need to get this small program running properly. I want to pass the final result (Hex value) to another program that will … | |
Is it possible to open an text file of any .exe extension software and read those characters into an array :?: | |
[code] #include<stdio.h> main() { int a=1; switch(a) { case isdigit('1'):printf("Hello"); } }[/code] This code works fine Hello is printed [code] #include<stdio.h> main() { int a=1; switch(a) { case isalpha('a'):printf("Hello"); } }[/code] But this code gives an error It says case label does not reduce to an integer | |
hello everybody [CODE]void func1(){ // do something //exit the function if some error occurs (like segmentation fault) but continue running the rest of the program } void func2(){ //do something //exit the function if some error occurs (like segmentation fault) but continue running the rest of the program } int … | |
what does i##j mean in macro definition of a program | |
[CODE]#include <stdio.h> #include <stdlib.h> int add(int i, int j , int k) { while ( i != 0) { j = i % 10; k = k * j; i = i / 10; } return k; } int main () { int num, num2=1, r; int ret=1; int i=0; … | |
I will love to be a good programmer, but how do i go by it. | |
Can you help me for the following problem: Implementation of a program in C that solves the problem of competition between the four processes that share the source of the network card with the semaphore method | |
Hi, I've been trying to learn what pointers are and how they function, and I now finally understand most of it. However, I don't understand the assignment of strings to a char *, and what the values they have mean. I wrote a small program to learn: [CODE]#include <stdio.h> #include … | |
I am working to take c code from an academic paper and edit. I am studying cryptographic algorithms. I have ran the following code, but I am having a little difficulty understanding two things. First, the program uses unsigned long ints. When they are added or subtracted, I don't get … | |
Hello! I have a problem. I can't use scanf() to set a value of the second member of the person struct. Why? I get an error that tells me "bad access". [CODE]int main(int argc, const char * argv[]) { struct Adress{ char *street; char *postal; int zip; }; struct Person{ … | |
[CODE]#include<stdio.h> //#include<conio.h> //#include<string.h> #include<string.h> //#include<iostream.h> int main() { char al[28],b[104]; int i=0; int t,k=0; // b[0]='A'; scanf("%d\n",&t); while(t--) { // scanf("%s",b); gets(b); gets(al); //gets(al); //printf("%s",b); //puts(al); // scanf("%s",al); // for(k=0;c1!='\n';k++) // { // scanf("%c",&c1); // // b[k]=c1; // cin>>c1; // b[k]=c1; // } // printf("hello"); // puts(b); // gets(b); // … | |
Hello...just started learning C and i'm trying to write a program that solves quadratic equations...but every time i compile and run it and enter the 3 variables it crashes. I kept on looking but didn't find anything wrong with it...help? :P [CODE]#include <stdio.h> main(){ int a,b,c; float x1,x2; printf("Please enter … | |
Hi Programmers, Please help me, i was wondering on how to create a simple phone book program using struct array to insert a new contact, update an existing contact, delete an existing contact and to display the contact information | |
I have a C-code written in turbo C. I want to make a standard exe file that can easily run on any other PC as well which doesn't have TC installed. I have to provide my client simply an exe file which continuously monitors the serial com port for some … | |
I read through all previous post regarding quicksort on a linked list. The trouble I am having is using a random element, it seems all the other post are using the first or middle element where I want to use a random element for the pivot. in anycase here is … |
The End.