15,551 Topics

Member Avatar for
Member Avatar for I_m_rude

hi, int arr[2][2][2]={1,2,3,4,5,6,7,8}: int *p,*q; q=(int*)arr; printf("%d",*q); my question is that how is it giving output as "1"(ofcourse, without quotes). what will change if i don't typecast arr in 3rd line of code? will anyone please explain.Is it giving o/p "1" ,just because of that typecast ? my thinking: as …

Member Avatar for I_m_rude
0
255
Member Avatar for newbie1234

I want to implement public key cryptography in my poject. How to implement using c langugae. Is there any library or api. Thanks for help

Member Avatar for deceptikon
0
80
Member Avatar for rithish

#include <stdio.h> #include <stdlib.h> void main() { char a[50]; int n; printf("enter the string : "); gets(a); n=strlen(a); printf("%d",n); for(i=n;i>0;i--) { printf("%c",a[i]); } } the error is at i=n why cant we use i=n;

Member Avatar for WaltP
0
203
Member Avatar for Perry31

Hi geeks, I'm using visual studio to write and execute programs. I want to create breakpoint not like software breakpoints(F9 for debugging). I want to build the project in release mode and want to have breakpoint. I heard something like _asm int 3 to create breakpoint. Can anyone explain _asm …

Member Avatar for Ancient Dragon
0
313
Member Avatar for vegaseat

The computer is a binary beast. We want to go from the one-fingered digital box to the ten-fingered human being and convert binary to denary(base 10) numbers. This is how it works, for instance, binary 10010 is calculated as 1*16+0*8+0*4+1*2+0*1 = decimal 18. Just because it's easy, let's throw in …

Member Avatar for soorajshaji
0
2K
Member Avatar for rithish

#include <stdio.h> #include <stdlib.h> void main() { char str[10],str1[10],str2[20]; int i,j,k; printf("enter string1: "); gets(str1); printf("enter the string 2: "); gets(str2); for(i=0,j=0;str1[i]!='\0';i++,j++) str[j]=str[i]; for(i=0,k=j;str2[i]!='\0';i++,k++) str[k]=str2[i]; printf("%s",str); } not producing correct output

Member Avatar for Sokurenko
0
226
Member Avatar for rithish

#include <stdio.h> #include <stdlib.h> void main() { int a=5,b=10,*ptr,*pt1; ptr=&a; pt1=&b; b=*ptr; a=*pt1; printf("%d \n %d",a,b); } producing same values not swapped

Member Avatar for WaltP
0
101
Member Avatar for I_m_rude

hi.... int x=30, *y,*z; y=&x; assume x address is 500 and int is of 4 bytes z=y; *y++=*z++; x++; printf("%d %d %d",x,y,z); i want to ask that how the value of y is 504 here ? firstly value of z is assigned to value of y. then z is incremented …

Member Avatar for I_m_rude
0
201
Member Avatar for aldrin_ison1

Hi! I'm constructing a code for parsing results in an html form and I'm having problems with strcat. It's really weird 'cause I'm positive the syntax and all that are all correct. I can't seem to find where the problem is. Basically, I have this non-empty string "copy" and when …

Member Avatar for aldrin_ison1
0
238
Member Avatar for ashish karna

hi i want to convert the prefix form to postfix,prefix and infix form but when i input +5*62 it retuns only 2 what is wrong with my code can anybody help to solve this #include<stdio.h> #include<conio.h> #include<stdlib.h> #define Operator 1 #define notOperator 0 #define empty -1 struct node{ char item; …

Member Avatar for deceptikon
0
211
Member Avatar for techy50

hi! everyone. please could you give me some** great project ideas in C language**. Projects which deliver a practical solution to a problem . At the same time ,could you give some advice on how to start and end it perfectly. Thanks.

Member Avatar for Schol-R-LEA
0
237
Member Avatar for rahul pareek

When i declare array in c before main method it gives, an error. Declaration is char a[65000]; main() {} and another declaration in other file char a[63000]; main() {} has no error what is the reason.

Member Avatar for rithish
0
213
Member Avatar for rithish

#include <stdio.h> #include <stdlib.h> #include<string.h> void main() { char name[30],mname[40]; printf("enter the num:"); gets(name); strcat(name,123); printf("%s",name); } is it possible to concatenate num and character its not working how to concatenate numbers and character

Member Avatar for Ancient Dragon
0
185
Member Avatar for I_m_rude

hi, int fun(int(*)()) { ....... ....... ...... } int main() { ....... ...... ....... fun(main); ........ ........ } my question is that how can we use "main" (only name without parenthesis) as the pointer to a function ? because main() is a function. I am not getting it how is …

Member Avatar for deceptikon
0
112
Member Avatar for on93

how to do the total of value in the array ben[20] have to use function or other ??????? #include<stdio.h> #include<stdlib.h> void main() { int ben[20]; printf("pls enter 20 no\n"); for (int i=0; i<20; i++) { scanf("%d",&ben[i]); } system("pause"); }

Member Avatar for dawidbrook
0
119
Member Avatar for rithish

#include <stdio.h> #include <stdlib.h> void main() { char a[30],b[30],i; printf("enter the a: "); gets(a); for(i=0;a[i]!='\0';i++) { b[i]=a[i]; } printf("%d",b); } it produces a wrong output

Member Avatar for zeroliken
0
206
Member Avatar for rosechen

I have to wirte a code for monte carlo pi approximation for a menu driven calculator. here is my code but when i run it it shows me 1 instead of the pi value. can someone tel me what is wrong. double approximatepi(void) { double x,y,z,pi,randomnumber; double r,p,in; int tries; …

Member Avatar for WaltP
0
166
Member Avatar for wiliams.kikert

hi.. im new here, and this will be my very first post ever in this website.. i am using Dev C++.. so can you help me out a little here?? i have this code.. yes, some of these codes are found all over the internet.. but most of the code …

Member Avatar for Ancient Dragon
1
153
Member Avatar for sathvikareddy57

how do i implement a c program that removes all nonalphabets in the given string??

Member Avatar for Ancient Dragon
0
93
Member Avatar for patricioparga

Ok, I'm really having a hard time with this, but I don't even know what I'm missing. I t should be easy. Here's the problem: You have a linear equation system: a1x+a2y=a3 // a4x + a5y=a6. Ask for a1, a2, a3, a4, a5 and a6 as input, solve x and …

Member Avatar for I_m_rude
0
142
Member Avatar for rithish

generally we can build a application in java and vb make it as a exe.but how do we build application using c or c++.even some operating systems like xp was written in c++.how is it possible????/

Member Avatar for Ancient Dragon
0
149
Member Avatar for shibu2all

Hello, can anyone suggest me how to execute graphics programs(such as DDA line algo) using GCC compiler under windows? graphics.h is a part of turbo c and is not available in gcc.. so is there any way to do this??

Member Avatar for Schol-R-LEA
0
153
Member Avatar for rahul pareek

char a[5000]; main() {} and in another file main() { char a[5000]; } after compiling both file. exe of both file size have large difference. why

Member Avatar for deceptikon
0
271
Member Avatar for rahul pareek
Member Avatar for rithish

what is determinanat of matrix i have a code i dont understand what is the logic behind

Member Avatar for sepp2k
0
113
Member Avatar for MasterHacker110

In C++ you have this: std::string = "Name"; You can also read file with it, unlike reading the contents into a char[] with a limited amount of memory. So whats is C equivalent of a C++ string?

Member Avatar for MasterHacker110
0
3K
Member Avatar for priya.chitroda

Write a computer program using the C Language which reads any base-10 number from the standard input (keyboard) and writes its binary and hexadecimal representation to the standard output (monitor). this is what I have and I am super confused and need help please. and I have to create this …

Member Avatar for WaltP
0
237
Member Avatar for Qonquest

I am getting this output: This is the source string╠This is a destination string╠╠╠╠╠╠╠╠╠╠╠╠╠╠5Press any k ey to continue . . . My code is: void Problem5(char strDestination [], char strSource []) { int intIndexOfStrSource = 0; int intConcatenatedStringIndex = 0; int intStringDestinationIndex = 0; int intLengthOfDestination = strlen(strDestination); int …

Member Avatar for deceptikon
0
1K
Member Avatar for Hammad Akhtar

#include<stdio.h> #include<string.h> int compare_string(char *first, char *second) { while(*first==*second) { if ( *first == '\0' || *second == '\0' ) break; first++; second++; } if( *first == '\0' && *second == '\0' ) return 0; else return -1; } int main(void) { char string[1000]; char word[20]; char *s; int len; …

Member Avatar for Ancient Dragon
0
141
Member Avatar for joey_r

Hello everyone, I'm new to C and was hoping ya'll could review my code. It is a simple workout program that prints a list of exercises into a .txt file. The major bug is in main.c line 18 and the generateProgram function in boxing_functions.c line 57. I'm still learning pointers …

Member Avatar for WaltP
0
115

The End.