main(){
CountingSort c ;
int inputArray[10] = {23,12,45,46,25,12,32,43,32,29};
int* outputA;
c.setInputArray(inputArray);
inputArray = c.sort();
/*...
Type: Posts; User: pshirishreddy
main(){
CountingSort c ;
int inputArray[10] = {23,12,45,46,25,12,32,43,32,29};
int* outputA;
c.setInputArray(inputArray);
inputArray = c.sort();
/*...
thanks bithub
hello shouldn't the code below return 11 for "hello there", it returns me the size of the first word i.e 5 for hello
#include<iostream>
#include <string>
using namespace std;
int main(){...
char buf[BUFSIZE];
int bufp=0; //next free position in buf
int getch(void){
return((bufp>0) ? buf[--bufp]:getchar());
}
void ungetch(int c){
if(bufp >=BUFSIZE)
printf("too manu");
Aren't both of the below posted codes analogous
int getword(char *word, int len){
int cnt = 0,c;
for(cnt = 0; (c=getchar())!= ' ' && c!='\n' && cnt<len; cnt++)
*word++=c;...
bleh!
thank you...
i have analyzed the cases with
printf("%d\t%d\t%d\n",p->len++,p->len++,p->len++);
the out put i get is
2 1 0
and even with
Hello every one I dont understand why my output is different
here is my code
#include <stdio.h>
#include <stdlib.h>
struct {
int len ; //cannot initialize to a value directly
char...
thank you..
thanks tabstop, where can i get the list of switches for the corresponding libraries ?
So, are there switches for every library like the math library ?
Any idea on why the linking doesn't happen, though it solves the problem i am a little confused on why it doesnt compile the normal way. I never used the -lm switch before what does the switch do, i...
Even after i correct the function name i end up with errors like undefined reference to
/tmp/ccfw9Xlk.o: In function `num_zeroes':
fctr.c:(.text+0x33): undefined reference to `pow'...
hello,
I get the follow error when i compile the code
fctr.c: In function ‘main’:
fctr.c:17: warning: format ‘%ld’ expects type ‘long int’, but argument 2 has type ‘int’
/tmp/ccfw9Xlk.o:...
Thanks MK27
hello,
Its a come back for me to this forum after a long time,
I have got this weird problem that getchar wont function after two successive scanf's
#include <stdio.h>
main(){
int a;...
NUCLEON
that was very handy thanks a lot..
i would be implementing CRC then..
:D
okie then will try out some thing from it..
thank you laser light
than could you suggest me any solution for the same !!
#include <stdio.h>
main(){
char msg[32];
long int a;
gets(msg);
printf("%s",msg);
a=atoi(msg);
printf("%d",a);
}
yes it is indeed related to a checksum algorithm..
that is not actually the point i am worried about
its about the how to get binary values for a string
to perform such an operation..
its like checking the data here is the simple example
of xor of two int values
int a=10; // 1010
int b=5; // 0101
c=a^b; // 1111 = 15;
the same thing i have to do...
well my problem here was to check for some error by using the bitwise XOR (^) operator on two strings.
so for doing that i need to convert the strings to binary values i used the below method but...