15,551 Topics

Member Avatar for
Member Avatar for theCompiler

I am confused as to where Am I supposed to assigned a variable . my code goes like this [CODE]char text[]= "FRUITS"; printf("Enter between apple,orange or mango"); gets(text);[/CODE] I want to assign a variable "User_select" to that printf part .

Member Avatar for TrustyTony
0
84
Member Avatar for techie929

Hi, I am trying to print the values in enum. Here is the code: [CODE] #include<stdio.h> int main(int argc , char* argv[]) { char played[] = "This old man, he played "; int i=0; enum days{one,two,three,four,five,six,seven,eight,nine,ten}; enum days d; for(i=0;i<10;i++) { printf("%s %s\n ",played,d); } return 0; } [/CODE] Can …

Member Avatar for Narue
0
117
Member Avatar for theCompiler

how do i determine the winner in a game rock paper scissor ? i have 10 rounds and the one who has 7wins shall be declared as the winner but how am i supposed to do that ? great help is highly appeciated :)

Member Avatar for WaltP
0
121
Member Avatar for EddyWally

Hi there. I'm writing a simple system to order certain data. Now this is the deal: I have a bunch of files with the following filename structures (stored as strings): 0000[i]_FILENAME.EXT i represents a random number. Now I want to scan whether the file has that structure, and if it …

Member Avatar for EddyWally
0
165
Member Avatar for muktigeek

[CODE]void main() { char a=250; int expr=a+!a+~a+ ++a; printf("%d",a); getch(); }[/CODE] what is output and plz explain it..:):)

Member Avatar for Narue
0
101
Member Avatar for arlir

Hi guys, A good day to you all! I am trying to bulid a simple data base but two errors at compile time apparently are holding me back from running my program. I have tried to figure them out but my efforts are are proving worthless and that's why am …

Member Avatar for muktigeek
0
230
Member Avatar for Xufyan

here why should we have to write [B]c=1[/B] ?? i couldn't understand the logic of writing c=1 :s... please just explain the logic [CODE]void main(void) { int a,b,c=1; a=5; for ( b=a; b>0; b--) { c*=b; } printf ("The Factorial of %d is %d\n",a,c); getch(); }[/CODE]

Member Avatar for muktigeek
0
634
Member Avatar for fashxfreak

[B]Hi, i just want to know that from where i can download "VISUAL STUDIO 2005" free...[/B]

Member Avatar for Ancient Dragon
0
106
Member Avatar for VernonDozier

As far as I can tell, this is safe. It prints "Should Get Here" and nothing else, as expected and desired. In real life, CantGetHere is a function that actually IS called and does some arithmetic. To avoid a seg fault in line 14, I have a NULL pointer check …

Member Avatar for VernonDozier
0
178
Member Avatar for Prankmore

[code = c][/code] I am trying to write a program that takes a 10 digit phone number and inserts hyphens between the 3rd and 4th digit and the 6th and 7th digit eg. Enter phone number: 5553459875 Your number is 555-345-9876 I've decided that reading the number as an integer …

Member Avatar for Prankmore
0
347
Member Avatar for tubby123

[CODE]union { int a; char b; char c[10]; }u1; void main() { int l=sizeof(u1); printf("%d",l); getch(); } [/CODE] This gives the output as 10, shouldnt it be 2 + 1 + 10 == 13 ??? Can some1 explain ?

Member Avatar for Adak
0
82
Member Avatar for DesignGhosts

Hi Guys, Basically I have an application that reads in a .hex file and I want to be able to then sort the hex values out line by line into a 2D Array ready for further processes. Example of a .hex file [CODE]:10010000214601360121470136007EFE09D2190140 :100110002146017EB7C20001FF5F16002148011988 :10012000194E79234623965778239EDA3F01B2CAA7 :100130003F0156702B5E712B722B732146013421C7 :00000001FF[/CODE] Below code is …

Member Avatar for DesignGhosts
0
228
Member Avatar for pranavghodke
Member Avatar for Ancient Dragon
0
64
Member Avatar for Na'Vi

Hi, I'm having trouble understanding pointers and arrays. [CODE] course[] = "Numerical Methods"; printf("%c %s\n", course[6], course); printf("%c %s\n", course[6], &course[0]); [/CODE] I don't understand how the second print statement prints the same thing as the first. How does &course[0] print out the entire array? I thought it was just …

Member Avatar for Narue
0
77
Member Avatar for mrprassad

[code=c] #include <stdio.h> #include <string.h> #define MAX_input_size 100 struct RoutingInfo{ /* Structure to hold the IP entrys */ unsigned int IPDestinationNetwork; unsigned int subnetMask; int prefix; unsigned int gateway; char* interface; } entry[MAX_input_size]; int computePrefix (unsigned long decimSM){ /* computes the prefix of the Subnet Mask */ int prefix = …

Member Avatar for Narue
0
152
Member Avatar for jodzjcm

[CODE]while ((userinput[0]==userinput[1]||userinput[0]==userinput[2]||userinput[0]==userinput[3]||userinput[0]==userinput[4])&&(userinput[2]==userinput[1]||userinput[2]==userinput[2]||userinput[2]==userinput[3]||userinput[1]==userinput[3])) [/CODE] If the user types ABCC, the program must show double letter....but sometimes the code up there doesn't work correctly....suggestions or fix?

Member Avatar for jodzjcm
0
84
Member Avatar for tedman102

I have tried to get this program to work with no luck. How do you properly use the nested selection structure? (sorry for the lack of braces, I tried getting rid of some for less confusion. Didn't think it would work but thought I might as well try :D). I'm …

Member Avatar for tedman102
0
427
Member Avatar for menonnik

How can we calculate whether a number is a power of 2 or not in a single statement without using a loop? All the ones that I can think of use loops or don't satisfy the condition. for eg. The use of XOR doesn't work as it gives incorrect input. …

Member Avatar for TrustyTony
0
184
Member Avatar for ari$av3s

The task at hand is to write a program that accepts arguments from the command line and convert them into USD. For example, take command line argument Currency EU 350, and convert in into USD. Now, please bear with me -- I may be phrasing this incorrectly, but how do …

Member Avatar for Narue
0
150
Member Avatar for ari$av3s

I want to write a program where, 1. string1 is declared as char s1[80]. string2 is declared as s2[40] 2. Function needs to check that the sum of both strings is less than 80 characters prior to appending them 3. If the sum is greater than 80 characters, return a …

Member Avatar for Narue
0
111
Member Avatar for Thoronath

Hi. I wrote a calculator that calculates the given expression (eg, 2 +3 +4-3-1), it works only if you type expression and press ctrl-d, what i have to do to display the result after pressing enter Here's the code: [code] #include <stdio.h> int main() { printf("give expression \n"); char expression; …

Member Avatar for Thoronath
0
209
Member Avatar for ks94082817

suppose i want to read excel contents of 123 as 'one hundred twenty three'. please provide suggestion. srinivas

Member Avatar for Adak
-1
105
Member Avatar for newprogramer

It works for the first time but when it loop nothing is stored wondering whats wrong could someone help me out please? [CODE]void main () { char buffer[256] = {0}; char password[] = "test"; char c,i=0; int pos = 0; do { buffer[0]='\0'; printf("%s", "Enter password: "); do { c …

Member Avatar for WaltP
0
154
Member Avatar for jobs

I have a file pointer which was assigned in main. In the main, I just open a file to write stuff to it. I want to pass the file pointer to several functions so that they can write to the file. In the fucntion declaration I just add: somefunc(FILE *file) …

Member Avatar for Narue
0
1K
Member Avatar for iamthesgt

I am making a video recording program that takes input from a v4l2 webcam and outputs to an avi file. Using gstreamer in c, I have got most of the program to work, and the file is created. I can get the pipeline to display the video to the screen, …

0
166
Member Avatar for james6754

I am taking a step backwards in to C from C#. I am studying C# at University but feel I may be rather restricted as to what I can do later on. For that reason I would like to learn C (also to get a good idea about the real …

Member Avatar for Narue
0
169
Member Avatar for ineedsomehelp:3

I'm suppose to make a code that is suppose to check errors on inputted letters but I can't seem to get it right cause when I input something either wrong or right it still prints "ERROR" [CODE]void check(char a, char b, char c, char d,char e,char f, char g, char …

Member Avatar for ineedsomehelp:3
0
212
Member Avatar for tubby123

In programming terms, Is there any difference between Generate Anagrams, and Generate Permutations of a string ????

Member Avatar for Adak
0
146
Member Avatar for Prelektro

Hello, [URL="http://www.daniweb.com/software-development/java/threads/223488"]http://www.daniweb.com/software-development/java/threads/223488[/URL] I need C code for a problem in given link above. I tried to convert it to C code but couldn't do it, i'm kinda beginner. I guess it's easy problem for pro programmers so i really appreciate if you can help me out.

Member Avatar for Prelektro
0
310
Member Avatar for Serafel

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 …

0
232

The End.