15,550 Topics

Member Avatar for
Member Avatar for Um num num

heyy pplz I'm new to programming and C just now decided to set myself a project and chose to make a simple roulette game so far i got a basic idea but would require too much code and am sure there must be a simpler way.. if anyone could help …

Member Avatar for ProgrammingGeek
0
156
Member Avatar for Mark198995

My teacher just told us that we have to write this program that it will compile in ".c" i was taught ver little in my intro about c++ however i dont know how to write in .c and although i told my teacher he insisted that i read the book …

Member Avatar for cse.avinash
0
615
Member Avatar for saurabh_s

hi i was compiling a program in linux , the program had conio.h file which is generally used in turbo c in windows. now the program is not compiling and giving errors. so what is the substitute . as clrscr() cant work without this file.

Member Avatar for Duoas
0
536
Member Avatar for hackit

i want to learn the complete working of pointer in c. i tried it many times but it is very difficult so please help me.

Member Avatar for cse.avinash
0
160
Member Avatar for susees

[CODE]#include<stdio.h> #include<conio.h> #include<string.h> #include<ctype.h> int main() { char org[50],r[50],m[50],a; int i,j,c=0,length=0,h=0,g=0,z; char token [3] [20] = { "void", "main", "int"}; printf("\nenter a line:"); gets(org); for(i=0;org[i]!='\0';i++) { length++; } for(h=0;h<3;h++) { for(g=0;g<length;g++) { z=strcmp(org[g],token [h]); if(z==0) printf("Keyword:%s\n\n",m); else printf("NO_Keyword:%s\n\n",m); } } printf("\n"); system("pause"); return 0; }[/CODE] it is showin this warning....[Warning] …

Member Avatar for raptr_dflo
0
1K
Member Avatar for starkk

In chain hashing how can the order of deleting a node in double linked list be O(1) it should first check for the slot which is of O(1)and then it should check for the element to be to be removed in the linked list pointed by that slot which is …

Member Avatar for raptr_dflo
0
103
Member Avatar for NerdyChick27

I'm writing a simple cryptography program that uses ISAAC, and I've run into a wall. I am planning on XORing each of my input bytes with 1 random byte each that gets returned from the ISAAC PRNG. This is basically what I'm trying to do [CODE]while(input character != EOF){ read …

Member Avatar for Narue
0
372
Member Avatar for now how abt tht

I have the following code for shell sort (recursive) given in the question where t[ ] is an array to be sorted, n=no of elements initially. h is any large no initially,say h>n. [CODE]void shell_rec(int t[],int n,int h) { int aux,i; if(h<=0) return; if(n>h) { shell_rec(t,n-h,h); if(t[n]<t[n-h]) { aux=t[n]; i=n; …

Member Avatar for Adak
0
505
Member Avatar for starkk

can any one tell me what is the advantage of using double linked list over single linked list in chain hashing during deletion and searching of the node???

Member Avatar for tajendra
0
147
Member Avatar for catalin4

Hello!I'm new in this business(c learning ),for a month or so.I'm trying to learn C and so far i think i'm doing well.I have a friend who's helping me and giving me tips...the last time i meat with him he gave me a task:i have a garage with 3 floors(1,2 …

Member Avatar for Narue
0
135
Member Avatar for ameen_al

Guys, I’m trying to integrate libssh2 libraries(windows version libssh2-1.2.5) with Dev-C++( v4.9.9.2). The OS is Windows XP SP3. I’m facing the following error when I compile the test file ssh2_exec.c (built in example) file. Compiler Output: --------------------- [Linker error] undefined reference to `libssh2_session_block_directions' [Linker error] undefined reference to `select@20' [Linker …

Member Avatar for rubberman
0
996
Member Avatar for rohoni
Member Avatar for Narue
0
1K
Member Avatar for catalin4

I'm a newbie in C.For a month or so i have started learning and a friend is giving me tips and homework.My newest homework is something like this: I have a garaje with 3 floors,each with 10 parking spaces.Each hour cost 5$.Only the cars who have left pay. The problem …

Member Avatar for Adak
0
196
Member Avatar for huzaifah

Write a program that helps the user to consider a range of interest rates for a mortgage over 20, 25, and 30 years. Prompt the user to enter the amount of the loan and a minimum and maximum interest rate (in whole percentages). Then write a text file containing a …

Member Avatar for Adak
0
98
Member Avatar for khsoccer

I have a program assignment in my C and Unix class that allows the user to enter two numbers in binary seperated by (*,+,-,or /). It then has to produce an answer and loop back to the beginning. It also has to have an option to exit. Can anyone help?

Member Avatar for Schol-R-LEA
0
441
Member Avatar for Mouche

Hello. I'm using ncurses with a side project I'm working on, and I'm using colored characters. To use colors, you have to wrap each mvprintw() function with some code to set the color. I thought I'd write a function that wraps mvprintw() so I could just specify the color whenever …

Member Avatar for Mouche
0
176
Member Avatar for thejokerguy

hello Everyone! I want to implement fast transpose of a sparse matrix. It's really hard for me to understand the algorithm explained in book. Can anyone please explain in simple manner? Thank you ! :)

Member Avatar for avnish.singh5
0
7K
Member Avatar for veeresh_cm

Here I am searching a string in text file and replacing it with new string. In this code it finds but the new word wrights at the end of the text file and not replacing. Plz. can anybody help me..... [CODE]#include<stdio.h> #include<conio.h> #include<string.h> void main() { FILE *fp; int f=0,l,n=0; …

Member Avatar for TrustyTony
0
308
Member Avatar for acechauhan

Hi, I am just starting to code in C. While using the [code=c]#define sec 3600[/code] the compiler returned an error - expected identifier or ‘(’ before numeric constant. [code=c]#define sec 3600 #include<stdio.h> #include <stdlib.h> int main(){ /*Rest of the code*/[/code] If I change sec to seconds, the compiler does not …

Member Avatar for asitmahato
0
165
Member Avatar for Aman6o

I just started learning C and trying to run the following code (given in the book I am using) in Code::Blocks 10.05 compiler for windows. "error: too many arguments to function add_two_numbers ()" [CODE]#include <stdio.h> int main() { int var1, var2; int add_two_numbers (); var1 = 1; var2 = 53; …

Member Avatar for Aman6o
0
2K
Member Avatar for DJWK

This program should extract the first line. Somehow I'm getting the last line instead of the first... This is the textfile: [ICODE]N100 G96 S200 N115 G0 X600 Z-1004.95 T11 D2 M3 M7 H10 N125 G0 X500 N130 G1 X419 F0.5 N135 G1 Z-1004 N140 G0 X500 N145 G0 Z-419.7 N150 …

Member Avatar for DJWK
0
224
Member Avatar for lochnessmonster

Is the only point of string encryption is to hide a hardcoded string from being scanned and found in memory/binaryfile? I dont see how string encryption works 100% of the time though...it seems if any string that needs to be used will be stored in memory. For example, i can …

Member Avatar for TrustyTony
0
143
Member Avatar for volkang

Hi, I am writing a file by using fopen("xxxx.csv","a"). However, at a point when i open the same file it gives debug assertion error. The code is the following; I checked if anything, like "helloworld",can be written, but no. The "ENTER??" part is written in the file correctly for 5 …

Member Avatar for volkang
0
406
Member Avatar for Adak

Obviously, it should be titled: "Steak and Chicken Dinner Problem" A wedding reception will have 200 guests and the dinner budget is $9,000. [CODE]Wedding Catering Prices: =================== Chicken Dinner: $40 Steak Dinner: $50 [/code] What is the highest number of steak dinners you can serve at this reception, and stay …

Member Avatar for Adak
-1
122
Member Avatar for kangkan_14

Here is a part of code I am writing.I am getting a segfault in the CmpFunc function. The segfault occurs when I compare *a and *b i.e in the "if(*a>*b)" line. I am new to function pointers. So, I might be making a mistake somewhere which I don't realize.I would …

Member Avatar for kangkan_14
0
2K
Member Avatar for pravin_bug

[CODE]#include<stdio.h> int main() { int i=2,j=3; j= - - i--; printf("%d%d",i,j); return 0; }[/CODE] [B]Somebody please explain the working of this program[/B]

Member Avatar for pravin_bug
0
70
Member Avatar for starkk

what is the problem with this it is printing only the first node data :( .some one pls help me...[CODE]#include<stdio.h> #include<stdlib.h> struct node { struct node *prev,*next; int data; }; void create_list(struct node *list,int n) { struct node *n1,*n2; int i; n1=list; printf("enter the data for the 1 node:"); scanf("%d",&list->data); …

Member Avatar for starkk
0
413
Member Avatar for CD1

I am trying to implement the algorithm of a CRC check, which basically created a value, based on an input message. So, consider I have a hex message 3F214365876616AB15387D5D59, and I want to obtain the CRC24Q value of the message. The algorithm that I found to do this is the …

Member Avatar for Schol-R-LEA
0
1K
Member Avatar for Rupindersingh

Can anyone please explain me, step by step, each line of the following sorting algorithm which sorts the input lines numerically, if -n is given at the command line. (Program taken from the book "The C programming language, by brian kernighan and Dennis Ritchie" - Chapter 5. Section 5.11, page …

Member Avatar for L7Sqr
0
129
Member Avatar for theguitarist

[CODE] int i=5,j=10; printf("%d\n",(i=15)||(j=26)); printf("%d %d\n",i,j); [/CODE] THe output I expected was : 1 15 26 The actual output was: 1 15 10 In (i=15)||(j=26), shouldn't the brackets be done first?Isn't that the precedence order? So,first i must take 15 then j must take 26 then the || must be …

Member Avatar for theguitarist
0
141

The End.