Posts
 
Reputation
Joined
Last Seen
Ranked #1K
Strength to Increase Rep
+5
Strength to Decrease Rep
-1
44% Quality Score
Upvotes Received
5
Posts with Upvotes
4
Upvoting Members
5
Downvotes Received
8
Posts with Downvotes
4
Downvoting Members
7
3 Commented Posts
~22.2K People Reached
Favorite Forums
Favorite Tags
c x 110
c++ x 2

64 Posted Topics

Member Avatar for seo2005

The code is perfect and no errors execpt few things that shuold be avoided. may be you want to print from 5 * 1 = 5 5 * 2 = 10 5 * 3 = 15 : : 5 * 10 = 50 here is your code with slight modifications …

Member Avatar for Nehal512
0
683
Member Avatar for Jaks_maths

i support gaiety's answer with a slight alteration making the sum zero as the last statement in the first for loop, so that every time it will have a new sum. if thats not correct can someone provide a correct method. thank you BestJew, for digging old unsolved thread.

Member Avatar for mariola
-1
1K
Member Avatar for maubybark

Here we go, [QUOTE]my program is compiling and running but a long number is printing and not the age.[/QUOTE] you are printing the address of variable [CODE]printf("\n You have %.2d years to retirement\n", &retirement_years);[/CODE] is wrong. remove '&' before retirement_years in both if and else parts. change this condition to …

Member Avatar for uttamclasses
-1
274
Member Avatar for Iam3R

[CODE] #include<stdio.h> #include<stdlib.h> #define MAX 5 char queue[MAX][30]; int front, rear, temp; void init() { front = -1; rear = -1; } void insert() { if ( rear >= MAX-1 && front == -1 ) { printf("\nQueue overflow"); return ; } temp = rear; rear = ( rear + 1 …

Member Avatar for tirath9792
0
348
Member Avatar for DoEds

I hope what he wants he is just " find the middle element when you have given three elements" Ex: 1,3,6 the middle element is 3 ( this we cant get just by dividing) 5,6,7 the the middle element is 6. if this is the case : [CODE] int find_mid(int …

Member Avatar for krutarth
0
3K
Member Avatar for fedya

[QUOTE=Narue;1063789][B]>Can someone explain me what does this mean? >"40[^\"], %*c"[/B] Assuming it's actually "%40[^\"], %*c", it means read a string of up to 40 characters or until a double quote is found (%40[^\"]), then match a comma, any amount of whitespace, and ignore the next non-whitespace character (%*c). The %[ …

Member Avatar for uday jha
0
611
Member Avatar for Iam3R

Hi , i know one method of deleting a record from a binary file. that is : read the contents of the file and every time check for some criteria based on which we want to delete the record. if record does not match criteria then write to new file …

Member Avatar for Adak
0
1K
Member Avatar for Iam3R

hi, how the below code is generating out put as " -1 < ( unsigned char ) 1 ". i read in many books saying when we do operation with singed and unsigned value always the resultant will be data type that has more width . i understand that -1 …

Member Avatar for Iam3R
0
121
Member Avatar for bobyx

[QUOTE=bobyx;1209931]Hi.Thanks a lot from abhimanipal.[/QUOTE] instead of [CODE] Display_AdcX( adcvalmax[] ) [/CODE] use [CODE]Display_AdcX( adcvalmax )[/CODE] this does not work [CODE] # for(i,m=0;i,m<8;i++,m++){ //IS THIS FOR STATEMENT RIGHT? **************** [/CODE] there are other error your way of commenting is not correct.

Member Avatar for Iam3R
0
192
Member Avatar for Iam3R

Hi, i have written a program to find the power of two numbers using iteration. The problem here is that to return the correct out put for even powers but not for odd powers. b = base , e = expo ,p= power( b, e);; for even powers the statements …

Member Avatar for Iam3R
0
95
Member Avatar for Iam3R

Hi, [CODE] #include<stdio.h> int main( void ) { float a = 0.2; if( a > 0.2 ) printf( "\n a is greater than 0.2" ); else if( a < 0.2 ) printf( "\n a is less than 0.2" ); else printf( "\n a is equal to 0.2" ); return 0; …

Member Avatar for Banfa
0
103
Member Avatar for Iam3R

what is the correct declaration of pointer to a pointer to array of N elements. ( i want to store address of pointer to an array of n elements ) i am using the below declarions seperately , but getting errors. [CODE] int (*p)[4]; int (*p1) (*)[4] = &p; int …

Member Avatar for UncleLeroy
0
143
Member Avatar for Iam3R

1. Why Nesting of comments is not supported by c. code does not involve much complexity to have that. 2. Why Array partial initialization have zero appended. why it cannot do in normal declaration. 3. continued.... Thanks, 3R

Member Avatar for Narue
0
287
Member Avatar for Iam3R

Hi, I have written a program just to check the behaviour of the compiler. i expected an error in function call statement. but its not generating any error. the declaration of function we include to check the type of args and no of args and return value of function. but …

Member Avatar for Banfa
0
147
Member Avatar for sandyjain

[QUOTE=thekashyap;337647]That's coz you're using %f for scanning a double. Use %lf.[/QUOTE] Hi, rather old post but correct one for disscussions. i once used the %lf in one thread but it was said that there is no such specifier. [URL="http://www.daniweb.com/forums/thread241546.html"] http://www.daniweb.com/forums/thread241546.html[/URL] can some one explain whcih is the corect fomat specifier …

Member Avatar for Banfa
0
161
Member Avatar for Iam3R

Hi, Please some one clarify what does the below snippets mean and the compiler assumptions. which one is the correct one to use, what is the problem with others. [CODE] main() { } [/CODE] [CODE] void main() { } [/CODE] [CODE] int main() { } [/CODE] [CODE] int main() { …

Member Avatar for nezachem
0
226
Member Avatar for Iam3R

Hi , i have read that new line character gets converted to \r\n when writing characters to a file and converted to new line again when reading. but i observed one thing here. i have written contents hello followed by return key . and i have written a program to …

Member Avatar for Salem
0
124
Member Avatar for Iam3R

Hi , when i run the program i got the same out put by using memcpy and memmove but i dont understand the difference between them. manual page says that memory area should not overlap in memcpy but can in memmove. what is meant by moving memory and how its …

Member Avatar for Salem
0
693
Member Avatar for Iam3R

here i have two bubble sort versions. [CODE] void bsort() { int i,j,jc=0,ic=0,temp,swap=1; //for(i=0;i<NOE & swap;i++){ this one or for(i=0;i<NOE-1 & swap;i++){ \\ this swap=0,ic++; for(j=0;j<NOE-1-i;j++){ jc++; if(a[j]>a[j+1]){ temp = a[j]; a[j] = a[j+1]; a[j+1] = temp; swap = 1; } } } printf("jc=%d ic=%d\n",jc,ic); } [/CODE] i checked it …

Member Avatar for hiraksarkardg
0
111
Member Avatar for chriselda

[QUOTE=chriselda;1131342]pls. help me in how to program that...[/QUOTE] [CODE] char str[]="the quick brown fox and the lazy dog" ; int i =0; while(str[i] !=' ' ) i++; strcpy(str,str+i+1); [/CODE] works if the above is your requirement, analyze it yourself. happy learning...........

Member Avatar for Dave Sinkula
0
115
Member Avatar for Iam3R

Hi, i understand the ieee 754 representation. but can some one explain why we need to add specifically 127 to the power of 2. for ex: 5.75 ; 101.110 can be written as 1.01110 * 2 ^ 2 127 +2 = 129 . i.e 10000001 now IEEE 754 of 5.75 …

Member Avatar for Salem
0
75
Member Avatar for Iam3R

below is one simplest code to illustare the pyramid of number. [CODE] void piramid(int const c) { int r, x; for (r = c; r > 0; r--) { for (x = 1; x < = (2 * c - r); x++) { if (x < r) printf(" "); else …

Member Avatar for yila
-2
101
Member Avatar for Iam3R

[CODE] #define fst 1 int main() { #if( fst ==1 ) printf("FST\n"); #else printf("Dummy FST\n"); return 0; }[/CODE] if i replace the statement in line 4 with [ICODE] #if fst [/ICODE] also the code is working. can any one tell me what is the correct way , advantages and disadvantages.

Member Avatar for Dave Sinkula
0
103
Member Avatar for Iam3R

As far as my understanding and other referals i understood that when the address of a local variable is returned the first call using this address may print the correct value but if it is called after any other function may get undefined values. but my program is returning the …

Member Avatar for Tajon Wong
0
361
Member Avatar for Iam3R

Hi , so far i have been concentrating on programming aspects. now its time to learn some internals of C -compiler. Lexical Analyzer Parser Hashtables Syntax Checkers Expression Evaluators Symbol table : etc please share me some info related to symbol table what are the contents of the symbol table …

Member Avatar for Iam3R
0
165
Member Avatar for Iam3R

i am writting a program for finding the no of keyword ( occurances ) and operators occurances. i am taking the all the keywords in an array and all the operators in seperate arrays for each category of operators. char *kw[] = {"auto","break"..."while" }; char *Arth_op[] = { "%","*","+","-","/"}; according …

Member Avatar for Narue
0
83
Member Avatar for Iam3R

Hi, i have a doubt regarding conditional macros and undef directive. can i use undef for a function like - macro, by just specifying the name of the macro with out specifying the argument list as written in line 8. is the code correct with out these statements: [ICODE] #define …

Member Avatar for Narue
0
111
Member Avatar for Iam3R

Hi , I want to write a program on Lexical Analyzer: which finds the no of keywords, no of operators ( based on the classification arithmetic, logical,....), constants, and others. please suggest me one good method. i am using a method which follows as below: char *Arith_Oper[]={ "+", "-", "*", …

Member Avatar for Iam3R
0
112
Member Avatar for Iam3R

how the sizeof array is the total number of elements multiped by its base data type size, when the name of the array gives only the base address. [ICODE] int array [5]; sizeof array ; [/ICODE] gives 20 bytes. why not 4 bytes. because [ICODE] array = &array[0] .[/ICODE]

Member Avatar for Narue
0
104
Member Avatar for Iam3R

Hi, i understand merge sort & quick sort even i can write the programs but iam unable to understand its complexity. its very easy to derive complexity equations for selection & bubble sort. as the code is little complex & recursive nature i am unable to understand its complexity and …

Member Avatar for Narue
0
127
Member Avatar for Iam3R

[CODE] [Davis@localhost UNS]$ gcc U_bc.c [Davis@localhost UNS]$ ./a.out a=d i=100 f=0.000000 sizeof(u)=4 [Davis@localhost UNS]$ cat U_bc.c int main() { union test { char ch; float f; int i; }; //union test u={'a',21,34.65}; gives a warning excess elements union test u={100.23}; printf("a=%c i=%d f=%f\n",u.ch,u.i,u.f); printf("sizeof(u)=%d\n",sizeof(u)); return 0; } [/CODE] in the …

Member Avatar for Dave Sinkula
0
97
Member Avatar for Iam3R

Hi, I used Enum constant as a case of swict statement and trying to select by using the pointer to the structure , which internally has a union and a enum member. the union member again internally have three structures. even i debugged the code. the value of the variable …

Member Avatar for Iam3R
0
94
Member Avatar for Iam3R

[CODE] /*dynamically allocating memory in called funcion and freeing in caller*/ char** memall(int ns); #define Max 20 #include<stdio.h> int main() { char **s; int i,ns; printf("no of string you want to store"); scanf("%d",&ns); s=memall(ns); for(i=0;i<ns;i++) printf("addrs =%u and string=%s\n",(s+i),s[i]); for(i=0;i<ns;i++) free(s[i]); free(s); /* s=NULL; for(i=0;i<ns;i++) printf("%s\n",s[i]); *///dont try to access …

Member Avatar for Dave Sinkula
0
103
Member Avatar for Iam3R

Hi, I have little idea of padding. i read in one of the links that : all character variables gets stored in the memory location that is divided by 1. all short variables gets stored in the memory location that is divided by 2. all int variables gets stored in …

Member Avatar for gerard4143
0
144
Member Avatar for Iam3R

Hi, i dont understand the following; PLZ fix me. when i try to change the character pointed by pointer the behaviour is undefined. but when i change the same by using pointer as formal parameter of function it will be ok. why i cant change the base address of array, …

Member Avatar for Iam3R
0
122
Member Avatar for Iam3R

Hi , i want to use hash tables in my project. i got few codes in that i got some function called hash() [CODE] int hash(char *s) { int h =0; for (; *s;s++) h = *s + h * 31; return h % 101; } [/CODE] i understand the …

Member Avatar for Narue
0
109
Member Avatar for Iam3R

i run the below code and surprised to see the o/p . take a look and let me know whats happenning there. [CODE]#define print(x) printf(#x"=%d\n",x) int main(){ int a[10]; print(a); print(*a); print(*a+1); print(*a+3); print(*a+1-*a+3); return 0; } [/CODE] Out Put: [QUOTE] [Zonnie@telnet CPz]$gcc funny.c [Zonnie@telnet CPz]$ ./a.out a=-1073745776 *a=1 *a+1=2 …

Member Avatar for ssharish2005
2
203
Member Avatar for Iam3R

The Programming languages started with the low level language( 1's and zero's , so no conversion is needed. Assembly language is used mnemonics ( ADD,INC,DEC) so needs conversions as the machine cannot understand it directly. there comes the Assembler. Now the question is how the Assember was implemented, i mean …

Member Avatar for Iam3R
0
96
Member Avatar for michelle1

[QUOTE=michelle1;1066199]And another extremely lightweight unit testing framework is [URL="http://cutest.sourceforge.net/"]CuTest[/URL][/QUOTE] its really good . but i dont understand are these the rules that are followed in the industry.

Member Avatar for Iam3R
0
266
Member Avatar for Iam3R

Hi , I read that c is not a block structured language. means it does not allow defining functions inside other functions. but this code is not generating any error not even warnings, though we nest the functions. whats the story. [CODE] #include<stdio.h> int main() { int num; num = …

Member Avatar for Aia
0
93
Member Avatar for Iam3R

Hi i have written a program to check the precision of float and double values. i read that the precision of float is 6 digits and double is 10. but it is showing only 6 for both. do we need to make any arrangement for the system to print the …

Member Avatar for Iam3R
0
496
Member Avatar for Iam3R

hi , i have read that c99 introduced: inline,_Bool,restrict,_Complex,_Imaginary i have used _Bool here but do no how to use remaining all please any one used the above can help me. [CODE] int main() { _Bool b; b=true;// giving error true undeclared ,cant i use that way // with out …

Member Avatar for Iam3R
0
2K
Member Avatar for Iam3R

[CODE] enum fivenums {Z,O,T,TH,F,FI} int main() { char ch; int num; do{ scanf("%d",&num); switch(num) { case Z: printf("ZERO\n"); break; case O: printf("ONE\n"); break; case T: printf("TWO\n"); break; case TH: printf("THREE\n"); break; case F: printf("FOUR\n"); break; case FI: printf("FIVE\n"); break; default : printf("Invalid\n"); break; } getchar();// to eat '\n' terminator so …

Member Avatar for kvprajapati
0
82
Member Avatar for Iam3R

Hi , this one is with respect to C. (i) when we use array an array index always starts from zero . is it a standard one? or compilers are implemented that way? if compilers are implented that way they must have followed some standard. (ii) the array name cannot …

Member Avatar for Iam3R
0
89
Member Avatar for chet6

[QUOTE=chet6;1042604]Thanks for the reply.Its clear now.I want to build a small project in c which includes both graphics and pointer concepts using LINUX OS.Could you please let me know how can i proceed on this?[/QUOTE] pointers and graphics: no good idea: may be you can start learning ncurses and try …

Member Avatar for manutm
1
137
Member Avatar for timaquerra

[QUOTE=timaquerra;1048434]yeah, the whole matter is that i want to call void function in while loop as following: while(search(arg1, arg2, &arg3)){ ... } (search is void function) and when i execute the program, im getting following mistake: "controlling expressions must have scalar type"[/QUOTE] [CODE]while(search(arg1, arg2, &arg3)){ ... }[/CODE] this you cannot …

Member Avatar for Iam3R
0
171
Member Avatar for want_to_code

[QUOTE=thines01;1045927][CODE] #include <stdio.h> bool findLeaders(int a[],int n) { bool flag = false; int intHighest = a[n-1]; for(int i=(n-2); i >= 0; i--) { if(a[i] > intHighest) { flag = true; printf("\nleader = %d", a[i]); intHighest = a[i]; } } return flag; // returns fals if no leaders } void main(void) …

Member Avatar for thines01
0
121
Member Avatar for Iam3R

Hi, i like to know what are the different systems that have gstreamer built in, or systems which allows gstreamer to be installed. I also like to know what this below lines specifies: I found this in my shell of proc/version file Linux Version 2.6.9-5.Elsm gcc version 3.4.3 20041212 (red …

Member Avatar for gerard4143
0
109
Member Avatar for leena_gc

[QUOTE]firstly im a female not a male.[/QUOTE] does not matter here [QUOTE]secondly its not my entire assignment its a part of it[/QUOTE] its your problem , we got nothing to do with it [QUOTE]thirdly i want someone to help me understand with it by providing the source code,rest i have …

Member Avatar for sheikaman
0
165
Member Avatar for Iam3R

can somebody explain the behaviour of the statement printf("%d"); is it any where depends on the statements that present before or after it. i have some satatements that allocates memory dynamically. its printing one of that value. is there any proper reason for undefined behaviour.

Member Avatar for Tom Gunn
0
114

The End.