15,550 Topics

Member Avatar for
Member Avatar for aravindm

int main() { unsigned int i=65000; while ( i++ != 0 ); printf("%d",i); return 0; } The output for this program is 1 can anyone explain me how I got this output? Thanks in advance.

Member Avatar for rproffitt
0
164
Member Avatar for vegaseat

The bubble sort is slow and I thought it would be interesting to visualize the progress as it sorts an array of integers.

Member Avatar for David_50
5
741
Member Avatar for hadisur_rahman

int main() { int a=10; printf("%d",a); return 0; or return a; } # 1ts question:In the program Why you used 0 in return 0 ; and 2nd question : if you use a in return a; then it also print the correct output but why ? #

Member Avatar for sepp2k
0
280
Member Avatar for ram619

Hello everyone! this is a code to reverse strings of a array of char ptr. I am passing the char* array, dynamically allocating memory to reverse and link with the char* array. The print it gives in the str_rev() are perfect. But when I print same thing in main(), it …

Member Avatar for David W
0
201
Member Avatar for ram619

Hello Everyone, I got this question in some book. As per question we need to find a substring in a array of char* and replace it with another string. The program I wrote doesn't work. I tried using strcpy as well char by char. Please help me to figure out …

Member Avatar for ram619
0
344
Member Avatar for aravindm

main() { int i=5; printf("%d%d%d%d%d",i++,i--,++i,--i,i); } Answer: 45545 Thanks in advance.

Member Avatar for Moschops
0
197
Member Avatar for can-mohan

I want to ask how to pass the '30','31','32' to SQL WHERE IN clause For example EXEC SQL DECLARE abcd CURSOR FOR SELECT Consignment FROM Transaction WHERE order_type IN (:dest) where dest will hold the value '30','31','32'. I have tried as above example but it is not working SQL did …

Member Avatar for can-mohan
0
324
Member Avatar for aravindm

I was asked to write a program to eliminate the reoccurrence of numbers in an interview? For example if I give the input as 2233555697 then the output should be 235697

Member Avatar for Mayukh_1
1
153
Member Avatar for bhaltulpule

I am trying to do simple math in c using a microcontroller. The C toolset uVision that I have does not have printf scan etc functions. In any case the code below reads in two parameters p1, p2 from the user over a serial port usig a simple routine GetHexByte …

Member Avatar for rubberman
0
239
Member Avatar for Strange&Evil

Hey Guys! I Have A Device With a Small LCD Module Like This (http://tiny.cc/gva5pw). And I Have to Write a Code in C To Display Text on The Module ! I Also Have To Run Program in a Minimal Modified Version of FreeBSD ! So Far I Havent Started to …

Member Avatar for Nathan_5
0
228
Member Avatar for Mayukh_1

I have made this code. It is working good. Can anyone please help me to make it more optimised? Here is the code. /* ∑∑∑∑∑∑∑∑∑∑∑∑∑∑∑∑∑∑∑∑∑∑∑∑∑∑∑∑∑∑∑∑∑ Author: Mayukh Sarkar Email: mayukh2012@hotmail.com Country: India License: GPL public Copyright ® © ¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬ */ #include <stdio.h> #include <stdlib.h> static int size = 0; typedef …

Member Avatar for David W
0
137
Member Avatar for Genius11

The problem is while i execute my code the function modifiko_note(); doesn't work in a proper way. It execute with errors.`` #include<stdio.h> #include<stdlib.h> #include<string.h> #include<sys/stat.h> #include<conio.h> struct student{ char emri[20]; char mbiemri[20]; int nota[100]; int grupi; }stud; struct lendet{ char emri[20]; int kredite; }lenda; FILE *bin; FILE *file; void regjistro_lende(); …

Member Avatar for Mayukh_1
0
356
Member Avatar for sfwr

this line returns `lvalue required as increment operand` error message with gcc-4.7 hwrcolor c; u8 *dest; *(((unsigned char *)dest)++) = c; I changed it hwrcolor c; u8 *dest; *((unsigned char *)dest) = c; dest += sizeof(c); and u32 * u32Dest; hwrcolor c; u8 *dest; u32Dest = ((u32 *)dest); *u32Dest = …

Member Avatar for Mayukh_1
0
681
Member Avatar for ms95

I have written a Makefile which compiles my mini-os with another application. I have to use -nostdioc and -nostdlib to compile them, but the problem is, that application is using stdio/stdlib functions and when I run my Makefile I get the error message that the functions used by my application …

Member Avatar for Mayukh_1
0
297
Member Avatar for danibootstrap

Hello, I am caputing sound from a codec using a microcontroller and sending it over to the laptop using a serial port .Now I want to use this buffer of values to regenerate the captured sound in Windows using C/C++. I have no idea about how to do it?Can some …

Member Avatar for Mayukh_1
0
195
Member Avatar for alexx006

Hi everyone, I’m beginner and I need a little help. I have to make RPN (postfix) calculator using stack which is implemented by singly linked list in C. Now I found that but in C++ and I’m having trouble translating it to C. Can you help me getting things to …

Member Avatar for Schol-R-LEA
0
292
Member Avatar for vijaykrishnabor

Swap 2 number without using third variable code do not use temp variable for swapping if the code was useful please let me know [code]#include <stdio.h> void main() { int a,b; printf("enter number1: ie a"); scanf("%d",a); printf("enter number2:ie b "); scanf("%d",b); printf(value of a and b before swapping is a=%d,b=%d"a,b); …

Member Avatar for Mayukh_1
-1
7K
Member Avatar for dbfud1988

#include <stdio.h> int main(){ int i,j,k=1; int loop_count = 10; for(i=1;i<loop_count;i++){ if( i > 1){ for(j=0;j<i+k;j++){ if( i == 2 ) printf("*"); else{ if( j%k == 0) printf("*"); else printf(" "); } } k++; }else printf("*"); printf("\n"); } return 0; }

Member Avatar for dbfud1988
-1
180
Member Avatar for siddy
Member Avatar for ann123

Hey, I need to create a war card game. I have a problem with linked list - I read about it but still I have a problem with writing the code. I made a deck of shuffled card and now I need to sort it out between 2 players... so …

Member Avatar for sandeepjkl
0
147
Member Avatar for dbfud1988

Doing simple domain name search Just enter sometimes Segmentation fault I really do not know how to solve this problem But some can be found ip i not idea Read what information can solve this problem I'm sorry my English is very poor

Member Avatar for dbfud1988
0
283
Member Avatar for printf

Representing the list may or may not matter for a specific algorithm, but what does a list has to do with a stack/queue?

Member Avatar for JamesCherrill
0
152
Member Avatar for danibootstrap

I am getting this error. LINK : warning LNK4098: defaultlib "LIBCMT" conflicts with use of other libs; use /NODEFAULTLIB:library serialtest.obj : error LNK2001: unresolved external symbol "void __cdecl fastICA(double * *,int,int,int,double * *,double * *,double * *,double * *)" (?fastICA@@YAXPAPANHHH0000@Z) Debug/vctest.exe : fatal error LNK1120: 1 unresolved externals Error executing …

Member Avatar for Moschops
0
333
Member Avatar for danibootstrap

I get this error in a c code of mine error C2440: '=' : cannot convert from 'LPVOID' to 'unsigned char * if((buffer = HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY, totalBufferSize )) == NULL) { fprintf(stderr, "Memory allocation error\n"); ExitProcess(1); } and even this error C2440: '=' : cannot convert from 'unsigned char …

Member Avatar for Moschops
0
799
Member Avatar for Slavi

Hey guys, I am debugging some random files trying to get into gdb and I came accross a question how many machine instructions are used for this : `double x, dx, ans;` I guess I could see based on memory addresses and the size of double that 3 variables are …

Member Avatar for Slavi
0
127
Member Avatar for Baalla

hello there let me explain my work i have a file i read from it the data after that i try to get the best vertex that it's max(degree/weight) when i find it i put it's neighbors into the glist and i put it into blist and delete both of …

Member Avatar for Baalla
0
158
Member Avatar for dmm1983

Hi all, i have been working on the Dijkstra's code for a couple of weeks and i am now puzzled on how to do it this is my code for it so far void d_run(Table T, Graph G){ Vertex V, W; V = 0; W = 0; for (int i …

0
78
Member Avatar for Clearner123

I found the following logic for binary search from the standard book i feel it fails in some /* binsearch: find x in v[0] <= v[1] <= ... <= v[n-1] */ int binsearch(int x, int v[], int n) { int low, high, mid; low = 0; high = n - …

Member Avatar for Clearner123
0
197
Member Avatar for vs88

Hi. i need to build an expression tree from a string and i dont get how to do it. for exapmle: str[20]="( (2 + 5) * (8 / 2))"; ![dasd.png](/attachments/small/4/268d6233b4e99809ef2994f89fb1ebcd.png "align-left") can some one help me? thanks.

Member Avatar for Schol-R-LEA
0
2K
Member Avatar for Mayukh_1

Hello guys can anyone please help me in a problem relating to file. The problem is that I want to use `fgets` on a c file from another c file and increment a the counter every time to get the number of lines and I also want to put the …

Member Avatar for David W
0
198

The End.