- Strength to Increase Rep
- +5
- Strength to Decrease Rep
- -1
- Upvotes Received
- 6
- Posts with Upvotes
- 6
- Upvoting Members
- 5
- Downvotes Received
- 10
- Posts with Downvotes
- 8
- Downvoting Members
- 8
75 Posted Topics
Re: you forgot to use the return value of your structure just place p=func(p); or if u want to use p to initialize and then use it's value u can use ptr to a structure | |
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 … | |
Re: then why don't you find 22 then after that -1 if the number before it is 22 then decrement it again untill the number is not 22 then you have there is your first 22 | |
| |
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> … | |
Re: well maybe u can define ; as a other name then use other name as derived type | |
Re: I just downloaded Code blocks today since alot of people here said its cool etc I also have also msv8 it have everything msv8 has + it opens faster and got gcc compiler so I vote code blocks for msv8 you need like fast computer i got alrdy 3 mb … | |
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); … | |
Re: also remeber don't use void main since u might want to check it's return value if it's return sucess or right also main is a specailized function which alawys start the program at like entry point for example . u should see some tutorials on c before doing anything on … | |
Re: start with strlen(name)-1 then pop untill limit is reached or when char itself ur popping got space in it | |
Re: why don't u just use fgets and read in portion coz like this your scanning starting addr of the file which u can't do that coz u didn't read the buffer of the file or anything into a string so u cant expect it to start directly i suggest you … | |
Re: remeber in binary search it stuff needs to be arranged i didn't read your code but i don't see any arranging function in it | |
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 ? | |
Re: c doesn't have call by refrence since the value if it's not a ptr it won't change only it's copy will in the function if u want it to change u need to pass the address | |
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 … | |
Re: it's used in the static memory that memory is intilised and won't quit like automatic variables it will retain there values even after functions end | |
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 … | |
Re: here your simply doing a loop that prints 5 character untill row becomes 9 and that code [code] if (row) { printf (" "); row++; } else { printf(" "); row--; } [/code] will never enter row-- since any non zero number is true what u should do is explain … | |
Re: "" stuff between is character string '' between s character which has ascii representions or can be any other system represention like strings always end with NULL to mark the end character is just 1 character | |
Re: well i don't really have much knowledge in language development but if you want it like middle language you can use asm after all c is asm based | |
Re: also why don't you use and operator if(!strcmp(pw,pw)) && if(!strcmp(idid)) { excute following command}; also you should convert a to either upper or lower so you do better only 1 if statement | |
Re: why dont you use realloc rather than freeing and allocating? | |
Re: just do nested loop first loop looping through file and 2nd loop checking if that string is contained within if its contained then use strstr and delete that by placing NULL at its ptr then rewrite it to other file | |
Re: yes it will work altough u need to work on your indentation | |
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 … | |
Re: you can cr8 a batch file that check attributes of hidden files and then write to batch file after you retrieve them write deleting attribute but thats long task i think there api for these stuff | |
Re: with void i think you need to cast according to the type at first not set a void ptr to void ptr | |
Re: you can also do something like while(!answer()) reget user choice //then when its out of the loop puts("welcome to the treasure of centries "); if you know about functions ofcourse and if you dont then you could just just do scanf inside loop and keep scanning till while(strcmp(Name1,Name)) you cant … | |
Re: just make it as an atoi but change base 10 to 16 you can make it unverisal aswell that work for all bases by applying a 2nd argument in atoi copy specifying the base | |
Re: lol srsly thats soo stupid thats y most professional programmers arent from college there self taught lol and btw arrow operator is ptr to structure -> they should tell you basics before you should even tell you to translate program to english | |
![]() | Re: you should read the documents abt realloc before you do it right away ![]() |
Re: also you should note that you forgot to free allocated memory by malloc | |
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 … | |
Re: if its multi dimensional array then u have to keep track of the counts ur comparing like for example for(i=0;i<MAX;i++) //this is a case in which string have same count if(!strcmp(SzString[i],SzString2[i])) { //do stuff}; | |
Re: just post your code and show whats wrong with it and what do you mean by return 35 times ? you mean there will be 35 seats in the bus ? and max booking is not more than 35 seats? | |
hello guys i m wondering how to convert hex to string | |
Re: I got one idea though coz hang man doesnt require junk genrator names unless you do a real name genrator my idea is have the program read from you 3 names for the movies or any other names and it will choose randomly between the 3 or more if you … | |
Re: just use strstr and use its return value to copy it | |
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 … | |
Re: and you can also use while(*p++) it will increment addr till it meet \0 in a char * | |
| |
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 … |
The End.