15,550 Topics

Member Avatar for
Member Avatar for nitin1

I am curious to know how I can make my own library and use it for my C/C++ programs? I mean I want to make a library say "maths_example" which will have 2-3 files having some basic functions of maths. Then, I want to use that library for my programs …

Member Avatar for nitin1
0
160
Member Avatar for Bhavesh Nariya

#include <stdio.h> int main() { int x = 10, y = 5; // Code to swap 'x' and 'y' y=x+y-(x=y); printf("After Swapping: x = %d, y = %d", x, y); return 0; }

Member Avatar for Hiroshe
0
98
Member Avatar for sujith1038

#include<stdio.h> #include<stdio.h> #include<conio.h> #include<math.h> void mergeSort(int arr[],int low,int mid,int high); void partition(int arr[],int low,int high); int decimal_binary(int); int main() { int count=0,k,d[10],c[10],b[10][10],a[10],i,sum=0,n,no,j; printf("Enter the number of binary numbers"); scanf("%d",&no); printf("Enter the binary number"); for(i=0;i<no;i++) scanf("%d",&a[i]); for(i=0;i<no;i++) { n=a[i]; for(j=0;j<4;j++) { b[i][j]=n%10; n=n/10; } } for(i=0;i<no;i++) { for(j=0;j<4;j++) { if(b[i][j]==1) sum=sum+pow(2,j); …

Member Avatar for dinad578
0
154
Member Avatar for anumash

This question refers to the automatic storage class and its scope is defined as local to the block in which the variable is defined and is alive until the control is present in that block where it is defined. Consider these two snippets ... main( ) { auto int i …

Member Avatar for rubberman
0
248
Member Avatar for COKEDUDE

I know this works as expected if your command line arguments are strings. #include <stdio.h> int main( int argc, char *argv[] ) { printf("Program name %sn", argv[0]); if( argc == 2 ) { printf("The argument supplied is %sn", argv[1]); } else if( argc > 2 ) { printf("Too many arguments …

Member Avatar for deceptikon
0
263
Member Avatar for hor3045

Hello, How woud I convert String to Integer using arguments from command line? I am stuck, and no idea where to start. Thanks.

Member Avatar for hor3045
0
596
Member Avatar for anumash

Hello all! I am having difficulty understanding why the range of signed integers is from -128 to +127? Assuming the size of the register is 8 bits and the leftmost bit is reserved for sign shouldn't the size be -127 to +127. I figured that for the negative values the …

Member Avatar for anumash
0
213
Member Avatar for PK.AMRAV

My coding shows error when built and run. The error shows multiple definition of 'main'. Can someone help me what I did wrong here? #include <stdio.h> int main() { FILE *fPtr; int c; fPtr=fopen("C:\\Question1.txt","r"); c = getc(fPtr); while (c!=EOF) { putchar(c); c=getc(fPtr); } fclose(fPtr); return 0; }

Member Avatar for deceptikon
0
243
Member Avatar for EarhawkPH

Okay, i've done atleast 4 programs. The problem is, how do i combine them using switch? TBH, switch is kinda confusing... Here's the kind of output i want: press [1] for program1 press [2] for program2 press [3] for program3 press [4] for program4 *Program Here* Do you want to …

Member Avatar for dinad578
0
763
Member Avatar for Mohamed_37

this is my code : #include <stdio.h> #include <stdlib.h> int main(){ FILE *fp; int i,n; char task[ 30] ; char filename[ 30]="c:\\out.c"; fp =fopen(filename,"w"); if(fp != NULL){ printf("Enter number of tasks for today!\n"); scanf("%d", &n); for(i=0;i<n;++i){ printf( "Enter tasks for today!\n"); scanf("%s",task); fprintf(fp,"%s\n",task); } fclose(fp); printf("\nDone!"); }else{ printf("couldn't open the …

Member Avatar for dinad578
0
276
Member Avatar for NardCake

Hello! Recently I've been working on a project which requires an API, the user supplies a function pointer which returns a specific value, this function needs a list of string arguments, similar to what you may find in the "main" function. I first thought maybe some sort of linked list …

Member Avatar for dinad578
1
5K
Member Avatar for ashiselma
Member Avatar for mind_1
Member Avatar for hydra.p
Member Avatar for Rashakil Fol
0
302
Member Avatar for Arjun_4

Hey guys, Im implementing a binary tree in C and i add values one by one into the Binary Tree , Once i select the Function to display the minimum and Maximum values the Program Crashes , Please help me fix this , greatly appreciated. Thanks . this is my …

Member Avatar for rubberman
0
338
Member Avatar for hydra.p

hi guys is it posible to generate numbers using array and link list in data structure? example generating number 1 to 5000, can you give me some examples?

Member Avatar for Scotthiggins
0
109
Member Avatar for bidhansigdel
Member Avatar for abdullahkafkas

#include<stdio.h> #include<conio.h> #include<stdlib.h> #include<ctype.h> #include<string.h> typedef struct Stack { char info; struct Stack *next; }Stack; Stack *start=NULL; Stack *cstart=NULL;//variable for copy of stack Stack *rstart=NULL;//variable for reverse of stack Stack* push(Stack *, char); char pop(Stack *); int main() { char c; int flag=0; printf("Enter characters :"); c=getchar(); while( c !='\n' …

Member Avatar for jwenting
0
211
Member Avatar for cambalinho

i'm trying building a BITMAP from memory, but isn't easy :( //create the button HandleButton=CreateWindowEx (0,"button", "hello\t\tHI", WS_CHILD | WS_VISIBLE | BS_TEXT | BS_BOTTOM |BS_BITMAP, 100, 100,500, 200,hwnd, (HMENU)4000,hInstance, 0) ; //create a dc and bitmap in memory HDC memoryDC =CreateCompatibleDC(GetDC(hwnd)); HBITMAP bitmap=CreateCompatibleBitmap(GetDC(hwnd),500,200); SelectObject(memoryDC, bitmap); //get the icon HandleIcon=(HICON)LoadImage(hInstance,"C:\\acrobat.ico",IMAGE_ICON,SM_CXICON,SM_CYICON,LR_LOADFROMFILE | …

Member Avatar for Mario Javier
0
1K
Member Avatar for lewashby

I copied the following from a back but I'm getting the erros that you see at the bottom of the page. #include <SDL/SDL.h> #include <stdio.h> #include <stdlib.h> int main() { int main() SDL_Surface *screen; if(SDL_Init(SDL_INIT_VIDEO) != 0) { printf("Unable to initialize SDL: %s\n", SDL_GetError()); return 1; } atexit(SDL_Quit); screen = …

Member Avatar for lewashby
0
235
Member Avatar for EarhawkPH

I'm trying to increase the limit up to a billion (or up to a hundred thousand). I don't know how. main() { long int a,b,c,d=0,e=1; clrscr(); printf(“Enter a Decimal Value: “); scanf(“%ld”, &a); while (a!=0) { b=a/2; /*Formula for Decimal c=a%2; to Binary*/ a=b; d=d+(c*e); e=e*10; } printf(“The Binary Value …

Member Avatar for sanjulovers
0
244
Member Avatar for ThatBitchYeah

Ok so now i have been able to write the code for adding and subtracting two complex numbers in rectangular form but now need to do the same for multiplication and division in polar form. #include<stdio.h> #include<stdlib.h> struct complex { int real,imag; }; int main() { struct complex x, y, …

Member Avatar for Amir Muhammad
0
767
Member Avatar for kartikeswar.parida

Here the switch() isn't working properly;not executing the function; & morever the while loop run twice when an invalid choice is given.. #include<stdio.h> #include<stdlib.h> #include<ctype.h> #include<string.h> #define MAX 100 int vowel_count(char*); int conso_count(char*); void to_lower(char*); void to_upper(char*); void menu(); int main() { int cnt=0; char data[MAX]=" "; bool flag=false; printf("Enter …

Member Avatar for sanjulovers
0
256
Member Avatar for neha1511

Friends, I want to know how to write a C program to embed text or data into the image, and also how to display this image as output. Can anyone please help me, its urgent guys!!!

Member Avatar for Ahmad_Khalaf
-1
985
Member Avatar for lewashby

I'm reading a book on C and it's telling me how to use gcc and about the -c option/flag. It reads "-c Compiles to an object (.o) file instead of an executable. This is important for creating library files." What is an object file and how is this good for …

Member Avatar for rubberman
0
138
Member Avatar for Harish_2

Hi All, Can you please let me know what these two functions do ? I would want to know for what purpose they are being used? Kindly help Harish //CallBack function for EnumChildWindows API call from SetOS2CursorForWindows BOOL CALLBACK EnumESLChildWindowsCallback(HWND hWnd,LPARAM lParam) { //CGI_CONV_OS2WIN_START //Function body modified according to keep …

Member Avatar for Suzie999
0
275
Member Avatar for engrghost

I am writing simple server client programs using socket, in which a client would request a video file and the server should send it that file. After recieving the file the client would play that video file. I know how to open ordinary text files and binary files but can …

Member Avatar for Andrea.Vieira
0
2K
Member Avatar for gesha

i need help for my school project in it. the function of the program is like a calculator that computes mean, median, mode, range, percentile, & standard deviation. and i dont know how to compute for mode, standard deviation and percentile. please they gave us dev c++ for out it …

Member Avatar for David W
0
1K
Member Avatar for shen06

Hello Guys! :) I'm Shen. I'm new here and to programming also. I hope you guys could help me learn more about IT and stuffs 'cause I'm really interested in learning things about computers and the technology. And also, I'd be very happy to meet new friends in here too... …

Member Avatar for David W
0
248
Member Avatar for iqra aslam
Member Avatar for iqra aslam
0
146

The End.