75 Posted Topics

Member Avatar for MrNoob

Hey its me again i dunno this string stuff gonna drive me insane really been doing since yesterday exercises on string did half of them but i have this program which should remove chars that i specify and when i test with putchar it does remove them but The string …

Member Avatar for MrNoob
0
173
Member Avatar for MrNoob

Hello i m suppose to make a function that fetch the strings according to num and it will stop when num is finished or it encounter , or ' ' or newline i made the function but its acting weird as if there is a \0 placed in [code] #include …

Member Avatar for Dream2code
0
232
Member Avatar for Katvillan

why are you using nested loop why dont u first fill the array with rand and make another temp array to hold the variables with same size and do another for loop to chk if that array[i]==temp[i] if its = then just rand() and its better to use srand(GetTickCount()); produces …

Member Avatar for MrNoob
0
170
Member Avatar for MrNoob

well i alawys wondered when i make char name[]="bla"; and count by ptr it doesnt work it says cant count wrong argument to increment but see whenever i like make it a function like void putit(char *Name); it work i dunno why though why does it work then if its …

Member Avatar for MrNoob
0
105
Member Avatar for shou2009

i think you can do this for the ; thing u do a list with stuff that doesnt have have ;(that is if it has more than 1 line) like for example for while if else if etc then after that if its not in the list chk the last …

Member Avatar for Nick Evan
0
298
Member Avatar for karpaklu

a pie char you must use graphics function or maybe like draw one by * but that will get somewhat confusing because u have to make it according to your % stuff

Member Avatar for MrNoob
0
116
Member Avatar for MrNoob

hello i m given a question in book i m reading that i copy element but using ptr to copy and other choice will be using normal integers to copy i did normal integer but copy i think i got a problem with it [code] #include <stdio.h> int copyarr(const int …

Member Avatar for MrNoob
0
94
Member Avatar for MrNoob

hey guys i know its kinda noobish not to understand them since i been coding for 1 month but there rlly some stuff which confuses me in multidimensional array and nested loops like here in this program I wanted to know if i sum up like in the array for …

Member Avatar for MrNoob
0
149
Member Avatar for olarotimi73
Member Avatar for spidyshiva

why dont you research an algothrim for image i think zip and one other is open source

Member Avatar for tux4life
0
96
Member Avatar for MrNoob

Hey i m reading tutrial about rucursion and got code whish isnt complicated or anything but i dunno why it prints the way it does [code] /* recur.c -- recursion illustration */ #include <stdio.h> void up_and_down(int); int main(void) { up_and_down(1); return 0; } void up_and_down(int n) { printf("Level %d: n …

Member Avatar for ankush chander
0
141
Member Avatar for macdonpr
Member Avatar for MrNoob

in my switch program keeps reading wrong input also i know i used way too much fflush(stdin); because stupid printf keeps inputting to the screen so scanf gets bad but i m sure i desinged program nice i dunno why when i like enter num 5 it keeps reading artichokes …

Member Avatar for MrNoob
0
152
Member Avatar for monkey_king
Member Avatar for Yrth
0
151
Member Avatar for MrNoob

hello i coding a program that need to sum array according to its num like for example num[0] will only do that and num[1] sum[1]=num[0] +num[1]; sum[2]=num[0] +num[1] +num[2]; etc i got one idea first i will fill the num array with numbers then i go through after that with …

Member Avatar for MrNoob
0
89
Member Avatar for MrNoob

Hello people i got a h.w to do Using nested loops to produce the following pattern: F FE FED FEDC FEDCB FEDCBA I had idea to do it but that will require array and strlen(char first int of the outer loop) and the thing says that I must do it …

Member Avatar for MrNoob
0
230
Member Avatar for MrNoob

okay i understand all bitwise operators but in the chapter of k&r at bitwise operators i m really lost at there question i have no idea how to do them Exercise 2-6. Write a function setbits(x,p,n,y) that returns x with the n bits that begin at position p set to …

Member Avatar for Tom Gunn
0
378
Member Avatar for girl_pt
Member Avatar for blackrobe

here example if you wanna read 3 characters [code] #include <stdio.h> #define REQUIRED 3 int main(void) { char name[]="NAME"; int i; for(i=0; i<REQUIRED ;i++) printf("%c",name[i]); //or if you want read full name for(i=0;name[i]!=0;i++)//read untill null terminator is reached printf("%c",name[i]); getchar( ); return 0; } [/code] remeber it will only read …

Member Avatar for s_sridhar
0
160
Member Avatar for sijithjp
Member Avatar for WaltP
0
86
Member Avatar for jusmeehh

average =sum/howmany why dont you after you read the array davide the array directly by i instead of just writing up the number yourself will make it more compact

Member Avatar for jusmeehh
0
177
Member Avatar for MrNoob

Hello i m reading chapter in K&R about bit operation whish totally confuses me i understand what all operators does but i dont understand the code itself [code] unsigned getbits(unsigned x, int p, int n) { return (x >> (p+1-n)) & ~(~0 << n); } [/code] it will right shift …

Member Avatar for jephthah
0
114
Member Avatar for MrNoob

i dunno im sure this output the good result i dont understand why it got not the output that i want [code] #include <stdio.h> void Squeeze2(char *str,char *save) { int i,x; int buffer=0;//used to save stuff for( i=0 , x=0 ; str[i]!=0 && save[x]!=0 ; i++, x++ ) { if( …

Member Avatar for csurfer
0
99
Member Avatar for MrNoob

i m trying to code htoi function in chapter 2.3 for K&R but problem i dunno where to start should i first read all string then after that change each character to its decimal and then add them ? or any better ideas?

Member Avatar for Narue
0
573
Member Avatar for MrNoob

I m trying to find the biggest number in the array but problem is that it keeps returning one [code] #include <stdio.h> int FindBiggest(int *arr,int choice) { int i; int num=0; for(i=0;arr[i]<=sizeof arr;i++) { if(num<arr[i]) num=arr[i]; } return num; } int main(void) { int arr[]={0,5,3}; int result; result=FIND_NUM(arr,BIGGEST); printf("%d\n",result); getchar(); …

Member Avatar for jephthah
0
139

The End.