31 Discussion / Question Topics
Remove Filter hi, I have some problems with winsock library so I am calling loading it dynmically then calling the functions so far so good,but the problem is for example I see in the winsock2 header files that - GetHostByName and some other functions are which I use there prototypes is kinda … | |
oke I was coding some stuff involving 2d array allocating i normally know how to do it in main coz you don't need to pass adr main ptr that get's allocated but when i made it i got somewhat confused I don't know why it went wrong [code] #include <stdio.h> … | |
hey i got something again i got confused by in PE files and they don't rlly explain why happens oke so what im confused with FileAlignment and SectionAlignment files must be aligned or sections to whatever count is right ? like if the it's less than the number (x) then … | |
I got problem with this function for adding icon to a program with small programs it corupts it and with bigger programs it doesn't even do anything [code] #include <stdio.h> #include <windows.h> #define MIN 2 char *ReadFile(char *SzFile,int *BytesCount) { int fSize; FILE *pFile; char *Buffer; if(!(pFile=fopen(SzFile,"rb"))) return NULL; fseek(pFile,0,SEEK_END); … | |
hey i was reading some stuff about windows i was wondering if file is loaded at virtual memory and let's say we load many files at once wouldn't that cause thrashing ? or exucatables are loaded into RAM then copied to virtual memory of hdd ? | |
hey i m reading about pe format but there something that i don't get RVA in documentation it says it just like a temp for addressing memory in other sections ok and it's just a DWORD what if there are many temperoralily variables wouldnt that overflow the that RVA value … | |
hi i m sorry for this noob question but there something i don't get i was reading abt File format like PE for example i was wondering how is C unverisal on MAC win and unix since they use diffrent file format does C takes care of each file format … | |
hey i m here supposed to extend calculator of K&R to support getline i made it but i dunno everytime i keep getting 0 poped not the numbers itself i debuged it i couldn't find where the bug is so hopefully someone will tell me what i m doing wrong … | |
Hello here in k&r excerise of primitive calculator i get it and all but there something i think its weird and i don't somewhat get it here the getch and ungetch functions i don't get it's routine [code] #include <stdio.h> #include <stdlib.h> /* for atof() */ #include <ctype.h> #define MAXOP … | |
well bascially here i started with K&R excerises with remove tabes and spaces i m not sure why my programs works in my head it does but even in puesdo code i did it does but arr[j] sometimes get intilised to values before [code] #include <stdio.h> #include <ctype.h> #define STOP … | |
hello i was reading today some stuff abt bitfield but here in this program I understand most of it but there unnamed fields inside the structure book says its stuff for allgiment or something like that i dont rlly get what does it do [code] /* fields.c -- define and … | |
I m trying to find idea to change like from 1 to one and 2 to two and 3 three from 1 to 999 i m had an idea to do like a string with information etc ? but i want better idea so i dunno how to do it … | |
hello i m suppose to do this program which should pass array of ptrs to a structure intilise and put student[i] info in each array i did most of it but now i got problem coz i cant just pass address of structure since its an array of ptrs to … | |
hello i m doing some function for saving a structure of some employee to text but i want to do it using ptrs to struct normally i tried first using ptr to struct in some main function to test some stuff abt it but i get runtime error [code] #include … | |
hello guys i m wondering how to convert hex to string | |
Hello guys I am reading some book but there and went to input validation but there is something logical i dont get in it you know when press enter with getchar() sometimes it transmits newline to the program but book has solution but i don't know why it works i … | |
hello i have last problem with strings i dunno whats wrong with this i dont get sometimes the logic coz when i write the program i do it into smaller stuff but this rlly string stuff drive me insane i hope i m gonna master it in the end anyways … | |
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 … | |
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 … | |
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 … | |
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 … | |
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 … | |
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 … | |
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 … | |
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 … | |
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 … | |
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 … | |
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 … | |
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( … | |
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? | |
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(); … |
The End.