Posts
 
Reputation
Joined
Last Seen
Ranked #707
Strength to Increase Rep
+3
Strength to Decrease Rep
-0
77% Quality Score
Upvotes Received
5
Posts with Upvotes
5
Upvoting Members
5
Downvotes Received
2
Posts with Downvotes
2
Downvoting Members
2
5 Commented Posts
0 Endorsements
Ranked #14.9K
Ranked #3K
~4K People Reached
About Me

Software Developer (C, C++)

Favorite Forums
Favorite Tags
c x 11
c++ x 3
Member Avatar for abd2

hi, this is the code: #include <stdio.h> main() { int m1, m2, m3, m4, m5, per; printf("Enter marks in five subjects\n"); scanf("%d%d%d%d%d",&m1,&m2,&m3,&m4,&m5); per=(m1+m2+m3+m4+m5)/5; if(per>=60) printf("first division\n"); if((per>=50) && (per<60)) printf("second division\n"); if((per>=40) && (per<50)) printf("third division\n"); if(per<40) printf("fail\n"); } this is the output for: [root@localhost lbin]# gcc -o division division.c …

Member Avatar for kimchong
2
2K
Member Avatar for bops

Hey all, I was just wondering, is it safe to do something like this? [code] char *msg; sprintf(msg,"Forename: %s", fname); //where fname has been previously defined as char fname[ ] = "Jonathon"; [/code] My main query is around the allocation of the memory for msg. I know there are memory …

Member Avatar for Raptor007
0
1K
Member Avatar for shankhs

Hi guys! I have started learning geometry and wrote a code to calculate the distance between a line(or a segment) and a point. Here is my code: [code] #include<stdio.h> #include<math.h> #include<stdlib.h> int dot_pdt(int a[],int b[],int c[]) { int ab[2],bc[2]; ab[0]=b[0]-a[0]; ab[1]=b[1]-a[1]; bc[0]=c[0]-b[0]; bc[1]=c[1]-b[1]; // printf("%d\n",(ab[0]*bc[0]+ab[1]*bc[1])); return (ab[0]*bc[0]+ab[1]*bc[1]); } int cross_pdt(int …

Member Avatar for Prabakar
0
149
Member Avatar for aannjjaallii
Member Avatar for kux

I've been searching for a memory leak detection tool for windows, something similar to valgrind under Linux, but all tools that i find cost, or just have free trials. Does anyone know a FREE memory leak detection tool for windows ?

Member Avatar for Kob0724
0
184
Member Avatar for Nemoticchigga

I am running a thread that does something, then sleeps for a while. If the program closes it continues to sleep to completion. How do I get it to abort immediatly, even if in the middle of sleeping? [CODE]void commThread::ThreadEntryPoint1() { while(1) { //do work Sleep(15000); //15 second sleep } …

Member Avatar for Tilir
0
104
Member Avatar for robertmacedonia

Hi, I would like to ask you for help in converting this code from C to C++. It's my little friend 's homework, but I can't help him 'cause I know nothing about C :( In fact, I just can't figure the "scanf" part out, I think the other part …

Member Avatar for Tilir
0
171
Member Avatar for tzushky

Hello, this type of structures are confusing. I hav been working with C for a while but this subtlety is yet unknown. I have come accross such a structure in a program where suposedly it will be used for FIFO management: [CODE=C] typedef struct FIFO_TAG{ struct FIFO_TAG *NextElement; }FIFO; [/CODE] …

Member Avatar for tzushky
0
271
Member Avatar for guardians

Hi, I can't seem to get my program to work. I'm using qsort to sort some keyboard-input strings, but I get segmentation fault. I tried 3 versons, and none of them works. Could someone pinpoint the error? [CODE] #include<stdio.h> #include<stdlib.h> #include<string.h> #include<search.h> int str_cmp(const void *prv,const void *vtor); main() { …

Member Avatar for guardians
0
233
Member Avatar for kzdev

I want to make a function to pass and return values from the same arguments. For example prm3=0 after function's execution must become prm3=3, and next prm3=6, and next prm3=9 ... I wrote the following but it doesn't work. p1,p2,p3 are not passed to prm1, prm2, prm3. What is wrong? …

Member Avatar for kzdev
0
104