15,552 Topics
| |
#include <stdio.h> #include <stdlib.h> int main() { char word[50]; int wordLength, i, reverseCount; reverseCount = 0; system( " color F5 " ); printf( "\n How many letters does the word have? : " ); scanf( "%i", &wordLength ); printf( " \n Enter word, letter by letter " ); for( i … | |
Hi there every body, i am trying to build this contact list to hold records for a purpoted library but i got a little stuck with a few issues that i would like you guys to look at. The fifth switch(delete) statement does behave strangely i should say. When I … | |
Hey guys I'm going through some questions, studying for exams and below is one which has had me stressing all afternoon. Consider a uniprocessor system executing concurrently two processes P and Q. Each process executes the code listed below, process P – procedure P, and process Q – procedure Q. … | |
Good day, i'm new in C.. can you give me some idea in how to program a moving cursor in the output screen and highlight the text... because i will use this in my coming final project in school.. we will make a system in TURBO C.. hoping for reply... … | |
so my project is about handling images. we have back end codes in c. now we need a GUI.. in what language should we create our GUI so that we will be able to connect our c code with the GUI? swing , vb.net?? i have no idea | |
the value of length is seven, word in file is hello, chosen_letter can be any that user guesses. chosen_letter is char ofcourse. my problem is when we type in character 'l' for chosen_letter and it only counts it once. also, the if-loop in the second while loop doesnt work. please … | |
Hi, recently i started taking lessons on c programming and my first assignment was to make programm which would name all the perfect multiperfect or superperfect numbers within a set (whose limits will be given as #define constants) and their percentage. Anyway apart from any logic errors (which i would … | |
I'm not sure if this is a duplicate question, so if it is, please feel free to direct me in the proper place, but I couldn't find an answer to my question. I am currently trying to switch from using an array to a linked list. (This is for an … | |
So for my program, I have to allow the user to enter a character then ask them how many of that character they want. I'm saving the character and the quantity into two different arrays. I've attached my code but when I go to display the array, it doesn't print … | |
I need help with this http://codepad.org/FNUci22s I am posting the ling of code pad because it has a way to execute it, so long story short. I use two different functions seno, sen (both for sin). When using the printf and adressing both to compare results I get from the … | |
Basically I am asked to reinvent the wheel a.k.a. the uniq commmand. I have to write a code that returns the number of occurence of each line in a file. I've done it a lot of times in Python and Java with a simple for line in file if given_line … | |
i want to write a simple programme with the function malloc on a function.. i want to write a function where i will have a table MAX(define the MAX) with strings and read it later i want to save every string on the table in that way that i don't … | |
Just a simple question, might sound stupid even. :) If I write a C program that incorporates execv or fork, does it work properly if I run the program on Windows? I heard that they are associated with Linux based system. | |
| Hi guys, so im required to write a programme that will make a table, along with the values and all and im also required to mark "X" at the minimum value of total time A+B (exactly beside the minimum value in the table). I tried using if statement but it … |
can someone teach me or show me how to code a program that can output color text?? thx :p | |
There is a piece of code in Linux Device Driver 3rd edition: #undef PDEBUG /* undef it, just in case */ #ifdef SCULL_DEBUG # ifdef __KERNEL__ /* This one if debugging is on, and kernel space */ # define PDEBUG(fmt, args...) printk( KERN_DEBUG "scull: " fmt, ## args) # else … | |
actually i tried a program like this #include <stdio.h> #include <stdlib.h> int main() { int a=8,b=3; a|=b; printf("%d",a); return 0; } i dont understand what happens here a|=b; i have used || this which is used for or but i dont understand wat happens above | |
just tell me will this sorting algorithm work out in linked list for(i=head;i!=null;i=i->next) for(j=i->next;j!=null;j=j->next) if(i->data>j->data) { temp=i->data; i->data=j->data; j->data=temp; } | |
I have a program that gives me estimation of pi, and time elapsed depends on my input numbers. Can someone please tell me how to compile this? I have the code but it's mystery how to compile and r un it... * Compiler: * mpicc -g -Wall -o name name.c … | |
hi, i have started learning c for 1 week and i am using VS 2005. from tutorials i learned that size of char is 1 byte i am using 32bit system but i tried this program: # include<stdio.h> void main() { char a,b; a=0xfffffffffffffffe; //now a is holding 8bytes thst … | |
please tell me what is the condition to use here.... if(CONDITION) printf("HELLO"); else printf("WORLD"); ok frnds now i want the output as HELLO WORLD | |
//************************************ //Includes #include <stdio.h> #include <stdlib.h> #include <string.h> #include <math.h> //************************************ //Globals int packed; //************************************ //Function Prototypes int pack_value(int value, int size, int low_bit); int unpack_value(int holder, int size, int low_bit); void get_date(int holder, int day, int month, int year); void get_permissions(int permission, int clas, int *read , int *write … | |
Hello, I have the following pseudo code that I am trying to implement in Java. My issue is the pseudo code seems to be heavily C based and my C is very rusty. Could someone help me understand the following function? uint theFunction(BYTE* header) { UINT length; header = header … | |
i need to copy the pixels from one image to another not all the pixels int copy(image2,i,j,image1 k,j) and return the image2 how to write the function completely | |
Hello, I'm new in C. I'm getting warning: warning: format '%s' expects type 'char \*', but argument 2 has type 'char (\*)[256]' Here is the code: typedef struct { char operation[256]; char value[256]; unsigned long long key; } Input; int main() { Input input; while (scanf("%s",&input.operation) !=EOF) { if (input.operation[0]=='+') … | |
hello everyone, im having a headache with this error im getting, im trying to read a number from a file but inside a Switch(case) statement but im getting alot of erros only inside the case and i cant figure out why if my open file code is correct (as far … | |
just writing and testing the code using arrays, int main() { int i,n; int arr[14]; printf("\nEnter the array ",n); scanf("%d",&n); int lastindex = n-1; int *l; l = &lastindex; for(i = 0;i<n;i++) { scanf("%d",&arr[i]); } for(i = 0;i<n;i++) printf("\n%d\n",arr[i]); printf("%d",*l); //arr[i] = lastindex + 2; //printf("\n%d",arr[i]); if(arr[lastindex[arr]] < lastindex) { … | |
In this program i have put numeric value in char variable. Trying to observe what happens when using %d and %c specifier. void main() { char ch=23; printf("value:%c",ch); getch(); } here when i use %d i get value:23 when i use %c i get some odd char. why the result … | |
I am trying to delete the leaf nodes in a bst which i have created non-recursively. The problem is when i am trying to delete the leaf node i hit a segmentation fault and i have no clue as to why its happening. I believe the code which i have … | |
Hi, I am trying to copy all contents from one directory over to another directory. This is the code I have so far: [CODE] #include <dirent.h> #include <errno.h> #include <fcntl.h> #include <pthread.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #include <sys/stat.h> #define MAXNAME 80 #define R_FLAGS O_RDONLY #define W_FLAGS (O_WRONLY | … |
The End.