15,552 Topics
| |
hi I am a high school student in a programing class and I need help writing my C program. If someone is willing to help me please let me know if I can contact you by email. Thank you. Jess | |
I am trying to calculate the size of char *. I would would think one of these 2 methods would work but they are not. char *vertices; printf(strlen(vertices)); printf(sizeof(vertices)); | |
int menu(c){ int choose; do{ printf("*MENU\n"); printf("*Press 2 to move down\n"); printf("*Press 4 to move left\n"); printf("*Press 6 to move right\n"); printf("*Press 8 to move up\n"); printf("*Press 5 to switch\n"); printf("*Press 0 to quit\n"); printf("Please enter your choose: "); scanf("%i",&choose); if(choose==2){ }else if(choose==4){ }else if(choose==6){ }else if(choose==8){ }else if(choose==5){ }else … | |
Im having problems creating a function that checks how many times a number shows up in the array The array is already sorted im trying to loop through the array and theres be a counter to keep track of the number of times it appears and then a second array … | |
I am trying to print a char array on separate line for each element. This is what I have tried and neither way is working. I would like the output to look something like. The array length is c c The array length is o o The array length is … | |
We estimate pi. We assume as in Figure 10 is a side of the square. The first type, which defines a function IsInCircle Quadrant is the point or not. intIsInCircle (floatx, floaty); The number of random points that are inside the square, the Number of … | |
How to set rand command, an integer from 3 to 50 (inclusive), but save it as a decimal number | |
Hi Everyone, I need help with my assignment but i only require assistance to give me some guidance on the issue. I need to write code in c linux programming, that can change directory [CD]. when you open the command prompt in the linux machine, you type cd .. or … | |
Write a program with Recursive function that for every step will receive input from a number of until the digits 0 entered. After entering the digits 0 It should be entered into the numbers entering printed in reverse order Track. | |
Here is a simple implementation of implementing a simple Left trim (ltrim) and Right trim(rtim) of unwanted characters from a C style string. (null terminated strings). Doesn't suffer the overheads of the memmove implementation in which the worst case scenario (a string containing all junk characters) is approx. N^2 / … | |
Can any one tell me how to check if the elements of two arrays are same? in c | |
I have my codes working where I got separate date and time columns. I would like to add one more column which have both date and time in. For the existing codes this how I did sprintf(all,'%02d:%02d:%02d.%06u%03u',CURDATE(),s / 3600, (s % 3600) / 60, s % 60, usec, nsec) I … | |
Hi everyone I had a few more quick questions...I'm trying to right the function that puts the correct letters in the right positons being reported from my previous compareletter function for my game of hang man and its not updating the word in progress array. Here's my function: //updates the … | |
case 3: Complement(a,m); that is the function call in main function void Complement(int a[10],int m) { int i,k; int c[20]={0,1,2,3,4,5,6,7,8,9}; for(i=0;i<=m;i++) { if(!a[] == c[]) { printf("\n%d",c[20]); } } } | |
I could like to take help from any of you to write a c code for finding complement of a set. i am a begginer so i need your help. thanks | |
how to write a recursive function to read and print all the data from a file | |
Hello everyone, I'm trying to do a game of hang man by comparing whats in one char array with another with a for loop with the compareword function. I tested it out with the wrong letters and had it return -1 so that parts working. What isn't fully working is … | |
Hello guys! I have some trouble with that "Do you want to continue" thing in C. I am begginer. Well my problem is to fix this one: ..... int sum_count_arithmeticaverage() { int n = 0; char answer; int array[1024]; int sum = 0, count = 0, arithmeticaverage; int i = … | |
The game is to play hangman, if guessed right or wrong it will ask the user if they want to play another game (w/ a different word). My code repeats the game with the user enters anything (even q) but doesnt quit when 'q' is entered. I've been trying to … | |
I was trying to write a code for union and intersection of two sets but i got an error which states clrscr and exit are not declared in scope. I have included the header files but still i get this error. Can some one help me out in this? | |
Hi, i'm trying to make 3 different input scenarios using argv. In the code below where there is just one input so when it is argv[0] the calendar for this month comes up, when it is argv[1] so when there are two inputs, it will printout the calendar for the … | |
The following is a function I wrote to go along with a minesweeper program. For some crazy reason, the inner loop gets skipped after i begins to increment. For example, after i and j have been reduced by one: n = 3, k =3 i = 0 j = 0, … | |
| Does anybody know how to make a program that calculates your work hours? I tried this code, but it's going all wrong. #include<stdio.h> #include<stdlib.h> #include<conio.h> #include<ctype.h> #include<string.h> #include<time.h> char* timein[5], timeout[5], p; int totaltime, ticktock, hour, minute, rate; FILE* f; int main(){ clrscr(); CreateTimeFile(); GetTimes(); DisplayFinalInfo(); getch(); } CreateTimeFile(){ f … |
| I'm doing a C program where the user is asked to enter an employee number. I know how to make the program ask again if the number doesn't exist. However, I don't know how to have the program check it from a *.txt file like this. EMP10-1234,smith_john,2 EMP08-0321,kent_brenda,1 EMP10-0501,delcambre_kory,3 EMP11-0112,pregeant_mark,3 … |
Here is my code.... #include <stdio.h> #include <stdlib.h> #include <string.h> #include <ctype.h> struct data{ int CustomerID; char Forename[15]; char Surname[20]; }; void CreateID (); //int checksize(); //void check number(); void CreateFirst (); int checklen(); int checknum(); void CreateLast(); int checklength(); //int checknumber(); void ViewRecord(); int main() { struct data records[2000]; … | |
| |
Hi eVeryone, Please help me on below code. I don't know what's the erorr mean. Error Message *test.c: In function ‘main’: test.c:12:2: warning: passing argument 2 of ‘tokenise’ from incompatible pointer type [enabled by default] test.c:5:6: note: expected ‘char **’ but argument is of type ‘char * (*)[100]’ test.c: In … | |
#include <stdio.h> #include <stdlib.h> double average(int arrx[6], int *ptr); int main(void){ int arry[6]= {2,5,4,5,6,7}; int count=0; double avg; avg=average(arry,&count); printf("The average is %.2f\n",avg); printf("Number bigger than average is %i", count); return 0; } double average(int arrx[6], int *ptr){ int c=0; int sum=0; double a=0; for(c=0;c<6;c++){ sum=(double)sum+arrx[c]; } a=sum/6; for(c=0;c<6;c++){ if(arrx[c]>a){ … | |
I hava a look at many header files they have codes like #ifndef and #endif what does they explain,please. | |
I have the function with following signature: void svdcmp(double **a, int m, int n, double w[ ], double **v) and variable "b" of the type double b[2][2]; When i am calling the above sub-function with command svdcmp(b, 2, 2, NULL, NULL); Dev C gives me the following warning: [warning] passing … |
The End.