Posts
 
Reputation
Joined
Last Seen
Ranked #630
Strength to Increase Rep
+7
Strength to Decrease Rep
-1
82% Quality Score
Upvotes Received
19
Posts with Upvotes
17
Upvoting Members
13
Downvotes Received
4
Posts with Downvotes
4
Downvoting Members
3
11 Commented Posts
~128.28K People Reached
Favorite Forums
Favorite Tags
Member Avatar for cse.avinash

[QUOTE]We have to use other testing for primality, and I believe cse.avinash has explored using the Sieve of Eratosthenes, which I take it were also unsuccessful. [/QUOTE]You guys should take a look at [URL="http://www.scriptol.com/programming/sieve.php#c"]this[/URL].The second one is much more powerful than the first one(I'm totally amazed by the results).

Member Avatar for vantrendin
1
6K
Member Avatar for mayankjoin

So , what's wrong with your program ? since we're not a psychic or in the mood of playing the"Guess what's wrong with my code" game, you have to tell us what exactly are you looking for.

Member Avatar for Niranjana_1
0
1K
Member Avatar for D33wakar
0
348
Member Avatar for D33wakar

This is a simple echo server that I've written while learning sockets programming. Compile the server and run it. You can connect to it using telnet like this: telnet localhost 1337 Disconnect the client by typing "/quit" without quotes.

0
382
Member Avatar for D33wakar

This is a simple hangman game that I wrote using my beginner python skills. Though this game is playable, there must be lots of things I must've been doing wrong or the methods I'm using here may be not so pythonic. So I want some suggestions on how to improve …

Member Avatar for TrustyTony
1
709
Member Avatar for MrNo

[QUOTE=MrNo;1704619][CODE]#include <stdio.h> #include <string.h> int main() { int count = 0; char *doc; FILE *inp; printf("Enter the file name: "); scanf("%s", doc); inp=fopen(doc, "r"); while((doc = fgetc(doc)) != EOF) { if (doc == ' ') count++; } fclose(doc); printf("%s contains %d words\n",doc,count); return 0; } [/CODE] So basically I'm a …

Member Avatar for zeroliken
0
316
Member Avatar for Lillylionhert

And here's how you use strtok (you know... for future references). [CODE]#include <stdio.h> #include <string.h> int main(void){ char line[20] = "Process0 12 1"; // suppose this is the first line read by fgets char* delim=" "; char* result = NULL; result=strtok(line,delim); if(result != NULL) printf("process:%s\n",result);//store process in an array result=strtok(NULL,delim);//first …

Member Avatar for Lillylionhert
0
4K
Member Avatar for D33wakar

If there's a list like below [CODE]s=['b','a','r','r','i','s','t','e','r'][/CODE] and if I tried to remove every 'r' from the list like this [CODE]>>> for x in s: if(x=='r'): s.remove(x)[/CODE] it gives the following result. [CODE]>>> s ['b', 'a', 'i', 's', 't', 'e', 'r'][/CODE] Why isn't the last 'r' removed from the list.

Member Avatar for D33wakar
0
102
Member Avatar for gizmo7008

[QUOTE]The program runs and compiles. When I enter the two words, it gives me a bunch of random stuff when printing[/QUOTE]That's because scanf is not used like this [CODE]scanf(x1,x2,MAXFORTHIS,stdin);[/CODE] [URL="http://en.wikipedia.org/wiki/Scanf"]click here[/URL]

Member Avatar for WaltP
0
918
Member Avatar for Master Mascus

[QUOTE]anyone can tell me what this line does?[/QUOTE]clearly, it's returning the uppercase of the character given to the function.The first return statement only works if the condition cl>='a'(i.e.97 in decimal) AND cl<='z'(i.e 122 in decimal).If it does so then the second return statement is not executed, but if it does …

Member Avatar for D33wakar
0
117
Member Avatar for Liuhh00

[QUOTE]The case choices does not run after the input of the integers 0 or 1.[/QUOTE] You're missing '&'before 'choice' in your 'scanf' statement . [CODE]scanf("%d",&choice);[/CODE] and another(important!) thing,look at this [CODE]int number, integer,choice; int ArrayN[20]; for(i=0;i<20;i++) { printf("Enter 20 Integers\n"); scanf("%d", &number); printf("ArrayN[%d]=%d\n",i,number);//well, that's stupid! }[/CODE] You have to assign …

Member Avatar for D33wakar
0
126
Member Avatar for Ich bin würdig

When you compile your 'C' code, an object file is generated by the compiler. Such object files from each program(from the collection of programs) are build into a single binary(executabe) file by another program called linker.

Member Avatar for Smeagel13
0
95
Member Avatar for The 42nd

[QUOTE]Can you tell me why use size_t and not int for orig_len and rep_len?[/QUOTE] Using size_t instead of just plain int or unsigned int makes your code more portable since the size of int types vary across platforms. Also the above standard functions expect their third argument to be of …

Member Avatar for The 42nd
0
308
Member Avatar for Daniel85

First of all, use code tags whenever you post any code.See that CODE thingy, click that and paste your well formatted code in between. There's no use of this `#include<conio.h> `in your code and why this `char studentanswer[30][30+1];` why not just declare it like this char studentanswer[30][31]; Since you're opening …

Member Avatar for Daniel85
0
162
Member Avatar for terence193

[ICODE]'fflush(stdout)'[/ICODE] forces the data (if any)in the I/O buffer to be written to the screen .Including a '\n' character(if suitable) in the [ICODE]'printf'[/ICODE] itself also does the same thing.[CODE]printf("incorrect value\n");[/CODE]Remember that [ICODE]fflush[/ICODE] is only used with output streams.Calling [ICODE]fflush[/ICODE] with [ICODE]NULL [/ICODE]argument flushes all the opened streams.

Member Avatar for YAMNA MIDHAT
0
198
Member Avatar for ram619

[QUOTE]This is a piece of code from some book.[/QUOTE]Is that [URL="http://www.daniweb.com/software-development/c/threads/389911/1679633#post1679633"]the same book[/URL] Narue told you to burn ? [CODE]int fun (const union employee *e); union employee { char name[15]; int age; float salary; };[/CODE]You should declare the union first and then the function 'fun'. [CODE]union employee{ char name[15]; int …

Member Avatar for ram619
0
193
Member Avatar for ahp@aol.in

The answer is in your error message [CODE]cc1: warnings being treated as errors test_cal.c: In function ‘calsum’: test_cal.c:20: error: control reaches end of non-void function[/CODE]Since function calsum is non-void(means returns something), so you should add a return statement. [CODE]return d;[/CODE]

Member Avatar for D33wakar
0
172
Member Avatar for DmytriE

It's a very , very messy code.Here are few things that I saw, that could be potentially causing the problem. 1.You have named many things "Information".First the struct for book data[CODE]/*Structure for book information */ typedef struct Information { char subject [MAXIMUM_TITLE]; char author [MAXIMUM_AUTHOR]; int edition; int year; float …

Member Avatar for D33wakar
0
112
Member Avatar for jtbens01

[QUOTE]The code compiles[/QUOTE]That totally amazes me.[QUOTE] but when I run the program it stops responding once it enters the while loop [/QUOTE]So there's a strong possibility that the problem lies on your while loop statement. [QUOTE][CODE] while (fgetc(inFile) != EOF) != NULL) {[/CODE][/QUOTE]'fgetc' returns EOF when read error occurs or …

Member Avatar for jtbens01
0
206
Member Avatar for thendrluca

[QUOTE][CODE]fflush(stdin); //clear the buffer???![/CODE][/QUOTE]Don't use [ICODE]'fflush'[/ICODE] with [ICODE]'stdin'[/ICODE],[URL="http://c-faq.com/stdio/stdinflush.html"]see why.[/URL]also [URL="http://c-faq.com/stdio/gets_flush2.html"]this[/URL]might be helpful. Either use [ICODE]getchar[/ICODE] after each call to [ICODE]scanf[/ICODE] to discard the '\n' from the input buffer or don't use scanf at all.There are [URL="http://docs.google.com/viewer?a=v&q=cache:V6IRXWslR5YJ:www.physics.ohio-state.edu/~ntg/780/handouts/interactive_input_in_C.pdf+how+to+take+inputs+interactively+in+c&hl=ne&gl=np&pid=bl&srcid=ADGEESiscFG8cYzt_lUxZk-m03JcLcXc46ILQ_roQLB6-39GuhhH1EHr_vn4eHVz6wZRzSOgJq3JkHiRbmJmOAM1OUT0mfpyZTeqn3qzq8dXgdXM5eUut8f1ddM-7LDs068yDWDu9lqq&sig=AHIEtbS9Sh6F_jZcWpfTiobG8o9XFEdAGg"]other solutions[/URL] for interactive inputs.

Member Avatar for thendrluca
0
336
Member Avatar for vinodhsml

Well, I compiled your code and entered the number 119 and it printed out: " not a prime Prime number" Do you need help or just mocking us? Can you explain the algorithm you're using for this?(only if you're willing to, there's no pressure)

Member Avatar for reojavier
-1
132
Member Avatar for ram619

What the ..? I mean, How the ...?[QUOTE]can anyone please tell me whats actually happening in this code. Seems to be as if incremented pointer is pointing to the next bit of same int.[/QUOTE] Why don't you try it in your compiler.did you?[QUOTE]Answer is 2,0[/QUOTE]So you did try it and …

Member Avatar for Narue
0
353
Member Avatar for VengefulToast

[QUOTE]Now, if anyone would be willing to assist me I would greatly appreciate it! [/QUOTE]I don't know what you need help with, since you have it all figured out.If you want us to write(or translate) your code for you, the forum rules wouldn't allow it. You have to use software …

Member Avatar for D33wakar
0
570
Member Avatar for whitech

you forgot to use '&' in your scanf statement. [CODE]scanf("%d",&n);[/CODE] but what's the point of this [CODE]for(m=1;m<n;m++) for(t=1;t<=m;t++) { n=m*t; printf("%d,%d",m,n); }[/CODE]

Member Avatar for cse.avinash
0
200
Member Avatar for mameemonster

[QUOTE]no. it is not the expression is wrong. but the program enter the input itself. blank input. and it direct tell to input the correct answer before i get to input anything.[/QUOTE]This is a very common problem.I hope [URL="http://c-faq.com/stdio/scanfc.html"]this[/URL] will make things clear. If not, try to Google it yourself.

Member Avatar for D33wakar
0
140
Member Avatar for mameemonster

just use [CODE]char* bus char* dest .../*and later*/ bus="single-decker" dest="taiping"[/CODE]

Member Avatar for mameemonster
0
112
Member Avatar for Liuhh00

[QUOTE][CODE]for(c_5=1; c_5<=10;c_5++) { for(c_6=c_5;c_6>=1;c_6--) printf(" "); for(c_6=10;c_6>=c_5;c_6--) printf("*"); printf("\n"); } printf("\n"); getch();[/CODE][/QUOTE] initialize c_5 to 0 instead of 1. [CODE]for(c_5=0; c_5<=10;c_5++)[/CODE]

Member Avatar for Liuhh00
0
133
Member Avatar for mkab

[QUOTE][CODE]int main( int argc, char **argv[] ) {//Wrong[/CODE][/QUOTE] [CODE]int main( int argc, char *argv[] ) {//right[/CODE]

Member Avatar for mkab
0
6K
Member Avatar for joshThtch

[QUOTE].for some reason sorting resets all entries to blank.Why is it doing that? I compare two entries, swap if necessary. Trying to figure out where that's failing.[/QUOTE]I compiled and ran your program, It works fine. In my opinion, in your 'DeleteEntry' function, try matching only the user's phone number, because …

Member Avatar for joshThtch
0
214
Member Avatar for Locke123

If you're using the variable val just to do this:[QUOTE][CODE]mov [val], ax add si,val[/CODE][/QUOTE]then there's no need to do so,just do it directly [CODE]add si,ax[/CODE] It's quite difficult to understand what you're trying to do, the information provided here is too little(not enough) and as far as your sample code …

Member Avatar for Locke123
0
210