15,552 Topics
| |
My basic problem is that I'm having a hard time implementing a Pthread that consists of a round robin dequeuing 4 arrays consisting of ints. Followed by a Pthread that creates random numbers with which to enqueue them with. I've written most of the code for the queue itself and … | |
[CODE]#include <stdio.h> #include <stdlib.h> #include <time.h> main(){ char cChoice; printf("****************************************\n\n"); printf(" FLIP!-TAC-TOE 3D \n\n"); printf(" Enter S to start the game or \n\n"); printf(" E to exit! \n\n"); printf(" Choice: ", cChoice); scanf("%c", &cChoice); if(cChoice == 'S') function1 (); else exit(EXIT_SUCCESS); printf("\n****************************************\n\n"); system("CLS"); void function1(){ char cMarker1; int i = … | |
hi there ! im new to programming , i cant figured out how to determine the highest even number and the lowest odd number among three numbers in C . does anyone out there have an idea ? i badly need your help . tnx in advance :))) | |
[CODE]void storedouble(int *determiner, char *line, char *line2, char *line3, char *line4, char *mem,char *mem2,char *mem3,char *mem4) { char temp[4]; //store nya sa temp temp[0]=*line; temp[1]=*line2; temp[2]=*line3; temp[3]=*line4; temp[0]=*mem; temp[1]=*mem2; temp[2]= *mem3; temp[3]= *mem4; printf ("%c",temp[0]); } [/CODE] THIS FUNCTION IS TO TRACK THE PREVIOUS USER INPUT....BUT IT WONT WORK..PLEASE HELP … | |
I have a string that has a bunch of white space on the end of it and was wondering if there is a simple way to eliminate the trailing white space with a standard C function. I know there is one called "String.trim" but I can't use anything that isn't … | |
I can't seem to "return" a value that is stored in "diff". I am suppose to give the value of diff to "int main()" to activate the void low() or void high() functions. But the program I did skips [CODE] difficulty(diff); if (diff == 'l') {low();} else if (diff == … | |
Ok, now I'm feeling dumb and all, but I need help on how to a print a secret random code if I said yes on cheat, and I should not let it be printed if the answer on the cheat is no(but it should still be stored in a value … | |
I have some programs that use the D-Flat Library. This is a DOS based library. I am looking for help with porting this library to Linux command line environment. I need pointers to documentation on how to replace the low level keyboard, mouse, video functions to the Linux command line … | |
hi, I want to run lkdemo.c which comes as a sample of open cv. Actually i am interested in using algorthim of optical flow in order to track movement of an object for my project but it gives error which says segmentation fault.my operating system is linux .it is showing … | |
The conditions for the question 1. you dont have any head ptr 2. you cant traverse as you dont have head ptr 3. its a singly link list 4. each node is dynamically allocated You only have a pointer to the node which you have to delete, and that is … | |
Hi all, I am currently extending a large C project with an own extension and I am stuck in a pointer/array/struct problem: The project offers a struct of this structure [CODE]struct ip_addr{ unsigned int af; /* address family: AF_INET6 or AF_INET */ unsigned int len; /* address len, 16 or … | |
//include files #include<stdio.h> #include<conio.h> #include<stdlib.h> #include"c:/includes.h" //stores the structures of master and index file #include"c:/function.cpp" //stores all the functions for the file primitive /* The main function input: none output:none calleed by: OS. calls: ADD_RECORD,DELETE_RECORD,MODIFY_RECORD,SEARCH_RECORD,DISPLAY_RECORD */ void main(void) { int choice; int status; int roll_no; char ch; clrscr(); printf("Enter the … | |
{ char user[]={'\0'}; char* animal_holder[12]={"Ant","Bear","Cat","D… printf("You have to guess what %c%c%c%c stands for.\n",animal_holder[a][0],animal_holde… printf("Enter your guess:"); scanf("%s",user); if(user==*animal_holder) printf("Your choice is %s",user); } What are the errors? | |
| |
In the code below I am attempting to establish a method of inputing a year with digits (only digits) into the character array of year. It works, but now if the inputed non-digits are 4 or more (i.e. "abcd") the program runs the printf command more than once. I recommend … | |
Ok, this is my 3rd time asking a question so far I can see that people here are very helpful and I appreciate it :) today I have a question if something like this is possible [CODE]#include<stdio.h> #include<stdlib.h> int difficulty() { char difficulty; printf("Level of difficulty? (l-Low,h-High) - "); scanf("%c",&difficulty); … | |
[CODE]struct marks{ int p:3; int c:3; int m:2; }; void main() { struct marks s={2,-6,5}; printf("%d %d %d",s.p,s.c,s.m); }[/CODE] Output 2 2 1 | |
char animal_holder[12]={'A','B','C','D','E','… char* animal_master[12]= {"Ant","Bear","Cat","Dog","Eagle","Gan… I've used the srand and rand function to get randomly a letter from the animal_holder array. Now if the program inputs ABCD....ABCD should be equivalent to ant bear cat dog from the string animal master....HOW TO DO THAT???? | |
I am looking to learn best practices for working with strings. Two issues that I have with strncat are that it is difficult to calculate how much space to allow, and that there may not be a null character in the string after the procedure. So if I have two … | |
When dealing with pointers, the "&" sign is called the address-of urinary operator. Knowing it's name sure helps to understand when to use it. Is "*" a urinary operator as well, and if so, what is its name? If it is not an operator, then what is it? Thanks. | |
using c++ program perform a cash egister process having an inputted money and the total amount purchase in a store ex. item1:___ item2:___ item3:___ ... up to item n:___ money =___ total purchases:__ change:___ anyone can help me with this program?? thanks BIG HELP .. | |
Dear Sir, I am student I want to research in image processing . So please give me some information about this and how to write program. Also plesae send the code for image segmentation and how tojoin the image. with regards Pradeep Kumar Mallick IIMT, Bhubaneswar | |
[CODE]************** TURN 1 **************** | | | | | | a | b | c j | k | l r | s | t __ |___| __ __ |___| __ __ |___| __ | | | | | | d | e | f m | W | n … | |
Ok, I need to make a program that randomly generates 4 random letters from 12 random letter and it cannot reapeat the same letter. for example you can only pick from a,b,c,d,e,f,g,h,i,j,k,l and the program can randomly generate a,b,c,d or b,c,d,e but should not generate a,a,b,b or something that repeats.Another … | |
Hi, I would like to print star pattern in the following way - **** *** ** * main() int i; clrscr(); for(i=4;i<=4;i++) { printf("*"); getch(); } It prints starts like **** I don't know how to complete the program. Can anyone please do the complete program for this so that … | |
[CODE]main(){ char cChoice, cMarker1; printf("****************************************\n\n"); printf(" FLIP!-TAC-TOE 3D \n\n"); printf(" Enter S to start the game or \n\n"); printf(" E to exit! \n\n"); printf(" Choice: \n\n ", cChoice); printf("****************************************\n\n"); scanf("%c", &cChoice); system("CLS");[/CODE] this is the task:Display a simple introduction screen at the beginning of the game. After making a choice … | |
Hi there! I am creating a game! [code] #include <stdlib.h> #include <stdio.h> #include <stdarg.h> #include <SDL.h> #include <string> #include "font.h" #include "SDL_rotozoom.h" SDL_Surface *back; SDL_Surface *image; SDL_Surface *screen; SDLFont * font1; int y = 750; char * string = "Made by Weliaz @ http://weliaz.me"; int xpos=512,ypos=384; double opos = 180; … | |
Hey very simple problem. I've been searching the site to see if I did anything wrong and I had to fail because I still get the wrong results (semantic error). Problem #1: Every time I use fopen with the "w" (or write) mode the file with whatever name given is … | |
Hi folks, I want to count the number of times elements in the array 'store' occurs. I have gone this far. What I want is to count the number of times the elements occurs like if 2 is occurring then it will begin with one, if again 2 is occurring, … |
The End.