15,552 Topics

Member Avatar for
Member Avatar for ThatJamaican

#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 …

Member Avatar for Gonbe
0
261
Member Avatar for arlir

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 …

Member Avatar for Adak
0
154
Member Avatar for BryantFury

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. …

Member Avatar for DeanMSands3
0
230
Member Avatar for cutterpillow20

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... …

Member Avatar for Ancient Dragon
0
1K
Member Avatar for seeking_help

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

Member Avatar for Ancient Dragon
0
174
Member Avatar for cynfudi

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 …

Member Avatar for cynfudi
0
131
Member Avatar for Tsaou

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 …

Member Avatar for Gonbe
0
313
Member Avatar for sarah.mathieson.7

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 …

Member Avatar for Ancient Dragon
0
199
Member Avatar for samii1017

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 …

Member Avatar for faroukmuhammad
0
915
Member Avatar for xikhari.some1behindu

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 …

Member Avatar for xikhari.some1behindu
0
267
Member Avatar for hexes

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 …

Member Avatar for deceptikon
0
233
Member Avatar for ntggl19

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 …

Member Avatar for deceptikon
0
129
Member Avatar for Limiter

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.

Member Avatar for nitin1
0
112
Member Avatar for Jenniferting

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 …

Member Avatar for Jenniferting
0
227
Member Avatar for kakilang
Member Avatar for ganeshchhetri
0
1K
Member Avatar for dspjm

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 …

Member Avatar for dspjm
0
122
Member Avatar for rithish

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

Member Avatar for VernonDozier
0
140
Member Avatar for rithish

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; }

Member Avatar for deceptikon
0
138
Member Avatar for jdh1231

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 …

Member Avatar for dx9_programmer
0
159
Member Avatar for cfresh

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 …

Member Avatar for deceptikon
0
148
Member Avatar for sannidhikumar99

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

Member Avatar for shashikumar s g
1
633
Member Avatar for ali11

//************************************ //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 …

Member Avatar for Adak
0
135
Member Avatar for kmachstang

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 …

Member Avatar for kmachstang
0
174
Member Avatar for prathiyus

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

Member Avatar for Adak
0
110
Member Avatar for GenieZ

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]=='+') …

Member Avatar for GenieZ
0
99
Member Avatar for xIXZeroIXx

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 …

Member Avatar for xIXZeroIXx
0
285
Member Avatar for prathiyus

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) { …

Member Avatar for Ancient Dragon
0
227
Member Avatar for katsmiley

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 …

Member Avatar for Tumlee
0
319
Member Avatar for maraghuram

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 …

Member Avatar for Gonbe
0
785
Member Avatar for jeeter19

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 | …

Member Avatar for fkjhadslf
0
2K

The End.