15,552 Topics
| |
I usually program in java but I'm going to implement this in C but the general logic psuedo code should work I would think. these numbers represent these characters: 2-abc 3-def 4-ghi 5-jkl 6-mno 7pqrs 8-tuv 9-wxyz If I were to type in a 7 digit number say 233-7687 as … | |
I dont have any idea what the problem is. But what I know is it stopped at fgets(temp, 256, stdin); when I run the program, it runs this line and then just stopped because of a segmentation fault. The silly printfs are just for me checking where it stopped exactly. … | |
Yes, I have looked in the forums for answers and have found plenty, and am asking about what I could not find. And yes, this is homework, but I need help and my professor has not responded thus far... now on to business. Description of Goal: Make a Set Data … | |
Im writing a code to generate invoice numbers. Im using a file now that increment to number each time but i was just wondering if there is a way to use time so that it can generate a invoice using time or date. Like the first 4 digit would give … | |
I need to treat a 1D-RAM buffer as a 2D array of a different type than what was declared, and have questions on different methods and what provides best performance. Questions: 1. How to set things up so I can access an element by something like "ptr[x][y]"? 2. Would any … | |
Sir, here is the qustion:- Nestor was doing the work of his math class about three days but he is tired of make operations a lot and he should deliver his task tomorrow. His math’s teacher gives two numbers a and b. The problem consist in find the last digit … | |
Hello Everyone, I am trying to emulate a T9 (cellphone) keyboard in C. So lets say a user types in the numbers "23", a possible word combination would be "be". In my question here, I will only write down a part of what I have assuming it only works for … | |
I have an assignment until next week and i don't know hot to complete it In the program in c we have to help a cat escape from a dog which has double speed. The program works as follows : the data of the program are read from the file … | |
Hi, I tried searching but I don't know how exactly to describe my question in 2-3 words so I didn't find anything. Is it possible to do something like this?Just to get the idea... I know it doesn't work: [CODE]switch(c){ case '1':{ (...) ; break;} case '2':{ (...) ; break;} … | |
Hi Friends, How can I create a number which will be construct with the array values. e.g. [CODE] arr[0]=2 arr[1]=5 arr[2]=8 arr[3]=4 [/CODE] now the number will be, [CODE]int num=2584[/CODE] please help me for this... Thanx...!!! | |
Hello, I have this assignment in C. The problem is that the functions have to be placed in separate files instead of just one. I haven't done that before. It seems code that would have run if the program was written in one file doesn't work when the functions are … | |
Gaussian elimination is designed to solve systems of linear algebraic equations, [A][X] = [B] This program reads input from a file which is passed as an argument when calling the program. Say the matrix is in file name matrix.txt so we call the program in this way: ------------------------- gauss matrix.txt … | |
Hello guys! :) I just wanted to ask something so that I can clear up things in my mind. What is the difference among Carriage Return ('\r'), New Line ('\n') and Line Feed? Is it correct to say that \n = \r + LF ? Thank you in advance! :) | |
[ICODE] Hi, here you will find a program which taking some inputs calculates the sales of 5 items on daily and weekly basis. Prevously I wrote it with no function, and it was quite a very long program, 9 A4 sheets, but this is written by using a function. As … | |
[CODE]#include <stdio.h> #include <stdlib.h> #include <conio.h> int main() { char _name[30]; int _age; printf("Hello Quester\n"); printf("What is your name ?\n"); scanf(_name); printf("...and what is your age, may i enquire esquire of peril and danger ahead\n"); scanf (_age); printf ("\nYour name is ",_name, (" \nand your age is "), _age ); … | |
Hi, I wrote a program that inserts nodes into a linked list in descending order.But whenever I test my code with numbers 12,14,13,19,7 in this order.Whenever I entered 7 I took 7 is already in the list.But as easily seen 7 is not in the list before I inserted.After give … | |
Can anyone please solve the following problems in C ASAP its verymuch urgent 1. C program to check whether the given graph is tree. 2. C program to check whether the Binary tree is full or complete or neither full nor complete 3. C program to extract spanning tree(without using … | |
just a simple for loop from 2 to 4(including for with increments 0.1 and 0.01. the problem is that when the increment is 0.1, the value of cur in last loop is 3.9; wheras, when increment=0.01 it is 4(as expected). all the variables are "double". any idea or suggestion? [CODE] … | |
Hi guys, Could anyone show me the best way to run a function every 10 minutes for ever? Thanks guys! | |
[B]The Producer Thread[/B] What does a producer thread write to the buffer? Create 20 different files (named in0.txt, in1.txt, ... in19.txt). [Testing Hint: you want to be able to tell from the text which file it is from, so the contents should be aaaaaa or bbbbbbb etc..] Vary the length … | |
Hello everyone I am new to this site. I have a university assignment in which I need to program a 2 player pacman game, using C and the Unix operating system. If more than 2 users have typed the command to run the program/s the users must wait in FIFO … | |
I'm supposed to make a program using getchar() to input the operation entered, then return the result of the operation after extracting the operands and the operator and calculating the result. if you enter 15 + 30 the result should be 45 or 15+30=45 Also using user-defined functions to do … | |
Hi I have a structure of members uint x,uint y (name is "ruudud") declared as global variable. Iv declared structure and pointer to structure globally in following way: [ICODE]struct ruudud{ unsigned int x: 6; // 64 max unsigned int y: 6; }; struct ruudud *r_ptr;[/ICODE] Iv allocated memory in following … | |
i just want to know if there is any good example tutorials using http post and put requests ? | |
Hello all, I've a small question. I wanna use a function void myfunction(int **array1, int **array2) where array1 and array2 shoud be [4][4]. I've added 2 arrays int myarray1[4][4], myarray2[4][4]; and called my function like this: myfunction(&myarray1[0], &myarray2[0]); I've got the following warning message : warning: passing argument 1 of … | |
If I have .txt file include 10 digits such as 0//start bit 1 1 0 0 0 0 1 0//parity bit 1//end bit If I put those into an array, how to check the first bit, the last bit and parity bit? How to convert the mid 7 digits in … | |
Hello, I'm making a simple C calculator using only getchar and putchar functions, my program works only if the arithmetic is entered correctly but if it's not, I can't make the proper error checking on it if the arithmetic is enteres improperly. EXAMPLE: 4 + 7 = 11 =====> Works! … | |
quicksort.c [CODE]#include "quicksort.h" int compare( byte *a , byte *b ) ; void memswap( byte *s, byte *t, int count ) { byte tmp ; while (count-- > 0 ){ tmp = *s ; *s++ = *t ; *t++ = tmp ; } } byte *select_pivot(byte data[], int n , … | |
this program i made.. should take an input 'no' from the user.. and print the following pattern.. 0 0 n+1 0 n+1 n+2 0 n+1 n+2 n+3 0 n+1 n+2 n+3 n+4 ....... n 0 n+1 n+2 n+3 n+4.. n-1 0 n+1 n+2 n+3 n+4 0 n+1 n+2 n+3 0 … | |
#include "includes.h" #include "constants.h" #include "functions.h" int pscore=0,cscore=0,ppaddle=185,cpaddle=185,ballSpeed = 0,cpuPadSpd = 0,frame = 0; SDL_Surface *screen=NULL,*secondary=NULL,*playerscore=NULL,*cpuscore=NULL,*cpuwin=NULL,*playerwin=NULL; bool gameEnded = false,selectedDiff=false; TTF_Font *font,*humungo; SDL_Event e; //PongBall ball; void cleanup() { SDL_Quit(); SDL_EnableUNICODE(0); exit(0); } bool init() { if (SDL_Init(SDL_INIT_EVERYTHING) == -1) return false; if (TTF_Init() == -1) return false; screen = … |
The End.