- Strength to Increase Rep
- +0
- Strength to Decrease Rep
- -0
- Upvotes Received
- 2
- Posts with Upvotes
- 2
- Upvoting Members
- 2
- Downvotes Received
- 5
- Posts with Downvotes
- 4
- Downvoting Members
- 4
Eternally Happy go lucky guy
- Interests
- Programming
- PC Specs
- Windows XP
52 Posted Topics
Re: What do u mean by "four in a row game" 1)Explain the game how it is.(game rules) 2)Also you can share ur coding and approach for the game. | |
Re: ping to the server name with count and time to live and then is satus is 0 server is up | |
Hi All, 1)I want to watch a directiory in unix using a shell script. 2)In case any change happens to any of the files inside that e.g new file creation or new directory creation or any file modification we need an automated mail. 3)Mailing part i will take care 4)on … | |
In which path gcc resides in IBM AIX.Due to some change change in my .profile the path variable got changed now i am not able to get the path of gcc. please help me | |
Re: i dont think that command intrepreter need to be loaded after the os starts. its just an application progam..which can execute other programs..dats it..!!! typing a external command and pressing enter means double clicking it on mouse!!!! | |
Can any one suggest me how to read EBCDIC Files (which generally comes form mainframe systems) using C. EBCDIC:Extended Binary Coded Decimal Interchangable Code (not sure about the full form) | |
Re: Why dont you use strstr() fucntion to find the beginning address of the match then get the string length of the 2nd sting. | |
Re: Its working fine with me..!!!No problem at all!!! | |
Re: sorry for the post..actually i posted it before visiting page 2..so editied it....!! IGNORE THIS.. thanks...!! | |
Re: igot what exactly you want: i think you want to convert your test string into hex code and store that in a file.(encryption) Again decrypt that and read as your previous string form that file. right? your problem: ------------ while converting a char to hex 1 byte takes 2 bytes … | |
Re: Dear Wesduncan, 1)Your indentation is relly bad.No one will look into your code.Arrange your code properly. 2)Before posting your code describe your problem verbaly along with the expected result and the result you are getting. 3)If possible try to post the required part of the code.No need to mention full … | |
Re: its not a place that we can solve your homework problem. still take some hints and show ur effort , the code you have tried so far.Then only you can expect something from this forum. 1)rand() function is used to generate random numbers. [code=c] int y=rand(); int num=(y-1)/y; [/code] then … | |
Re: when you want to hold integer value in a char..!! use modulo operator to ensure the range in 0-255!! like int a=300; char ch=a%256; so it will store 54 in ch. modulo operator ensures the range...!! why char stores on the range of 0-255 ------------------------------------------------- As an char takes 1 … | |
Re: use break; in the end of while loop to exit from the loop. [code=c] while(1) { int a , b , result; printf("Input a: "); scanf("%d" , &a) ; printf("Input b: "); scanf("%d" , &b) ; result = a/b ; printf("Result: %d\n" , result); break; } [/code] | |
Re: Solution:1 ------------- If you have strings consisting of many words like "abc def xyz" use strtok functions (space as a delimeter) to get the words. limitation:if multiple spaces occur like abc def xyz " it wont work perfectly. Solution:2 ------------- 1)read the string charecter wise (one char at a time) … | |
Re: include the proper header files.which all header files you are using? | |
Re: SHA-1 of a given string??what does that indicate?state through an example please....!! | |
Re: use [icode]exit(1);[/icode] to exit from the main program. else use [icode]return (1);[/icode] | |
Re: solution:1 ------------- 1)Do like strstr(mainstring,pattern) 2)until return not NULL.. increase pointer by strlen(pattern) e.g. "i am going am here" 1st pointer point to beginning of 1st am 'am' on the 2nd pass change return of strstr pointer by strlen(pattern). and so on. solution:2 ------------ 1)Do strtok(base_str,pattern) for each iteration...your end … | |
Re: No problem with your code.Its running fine. But you are not sure what you want 1)The inventory.ini file is opens only for record count purpose.you are not reading any data from the file. 2)The code is not fully complete. As of now its fine.Clarify you requirement and finish the code … | |
Re: Dear Killer Typo, "multi-threaded database administration tool" can you give some ideas/features of your project..!!! e.g the user interface Features and your design architecture so that one can think on that..!! how u managed your tables..data structures you used..memory mgmt...and so on..!! Thanks, DP | |
Re: [QUOTE=anuizath2007;930308]does anyone know how todisplay the following using a for loop in my program question:if n=5 where n is the ht of the pattern ********* **** **** *** *** ** ** * * if n=4 ******* *** *** ** ** * * SOLUTION I TRIED OUT IS #include<stdio.h> #include<conio.h> void … | |
Re: [QUOTE=vijayalakshmisn;930385]hi, anyone help me with the solution in C program applying file pointer concept[/QUOTE] Mention clearly what exactly you want i.e your program input expected output and also show your approach so that we can help you...!!! | |
Re: Here is your modifed code...changes are marked ac CC in comments [CODE=C] #include <stdio.h> #include <stdlib.h> int main() { int i; char TC; /* Character variable to count text and load ASCII array */ int TL = 0; /* Counters the number of characters in the entered text line */ … | |
Re: The real problem over here.Why the code fails. ================================= 1) ++*p++; ==>> ++ (*(p++)) ==> ++ (*k) where k=p+1(note:in k address of p+1 is stored) 2) ++ (*k) means it tries to increment the value at address of k by 1 which is a falure. 3)it should be *(++k) SOLUTION: … | |
Re: [CODE=C] #include <stdio.h> int copyarr(const int Mainarr[],int Target[], int * end); int copyarr(const int Mainarr[],int Target[], int * end) { while (Target < end) //change need to be done here *Target++=*Mainarr++; //change need to be done here } int main(void) { int const Mainarr[]={1,2,3}; int target[2]; int *end; end=target+3; copyarr(Mainarr,target,end); … | |
Re: [QUOTE=bubblellicious;926001]I need that in order to decrypt Vigenere's code. I have to count the distance between the repetitions in a text. My code does find the repetitions but not the distance, and that's why do I want to know, because I've tried many possibilities but none worked.[/QUOTE] Give two strings … | |
Re: its actually not a C program.Your program is in C++.Anyways Which compiler you are using? post a stand alone code so that we cant check the error!! | |
Re: Your coding standard is really horrible.anyways two problems found... the fucntions names in prototype and defination were not matching. 1)change menu to Menu 2)change Intialize to Initialize in the function definations [CODE=C] void Menu() //CC-1 menu changed to Menu { printf("\tchoose a task : \n"); printf("\t1] MakeNull \n"); printf("\t2] Insert … | |
Re: compile with -I option like tcc -I /tc/include(full include directory path) test.c | |
Re: I appriciate adatapost for this kind of encouragements. While swaping try call by value and also try call by reference. | |
Re: If the file is like this in each record u have a namefield and u want to find out name from each record. here is your modified code. comments are marked. file sample: ----------- John smith 23 bbsr John smith 23 bbsr John casio 23 bbsr linga mary 21 wasington … | |
Re: Dear waqarafridi, if you use scanf to get a string it will never take spaces so no question of triming. e.g [code=c] char a[10]; scanf("%s",a); //if u enter "hello world" printf("%s",a); //o/p will be "hello" [/code] Its the limitation of scanf. and for gets ..we dont specify the size of … | |
Re: [QUOTE=Ancient Dragon;927162]In C language the fgets() function will trim leading and trailing spaces from words read. It will also skip over '\n'. Text files do not contain '\0' bytes; if your file does then it is not a text file.[/QUOTE] may be you are confused with fread(). fgets will read … | |
Re: Tell your exact requirement in plain english.Then only we can help you to resolve it. provide following things: 1)Requirement 2)Desired input to the program 3)Desired output and then what is the issue you are facing? Are u able to run this code?if yes then provide stand alone piece. | |
Re: NO PROBLEM WITH THE CODE POSTED BY YOU. only 'P' is in caps in the printf function. thats it. and if u need the resule the move the line 9 to in between 12-13 as suggested by Ancient Dragon. [CODE=C] #include<stdio.h> int main() { float foperand1 = .0725; float foperand2 … | |
| |
Re: Find the corrected code.nothing to wierd about this.try to find out values of each elemnts manuall before writing the code. [CODE=C] #include <stdio.h> int main(void) { int num[2][3]= { {1,2,3},{4,5,6} }; int i; int x; int total=0; for(i=0;i<2;i++) [RED] for(i=0;i<3;i++)[/RED] //here i SHOULD BE x { total+=num[i][x]; } printf("%d",total); return … | |
Re: Be clear about your requirement: 1)How many fileds each line will contain. 2)How many lines the file will contain. 3)What all operations you will do after reading data from file After getting these things clear u can design your code. still if u need to read each field den 1)get … | |
While we allocate memory using malloc/calloc.That much bytes is reserved by the program.When the program terminates and we didnot free it what happens exactly? How to check memory usage by a program by writeing a C program. | |
Re: i agree with ancient Dragon , You can call Win32 API . One request to you, while asking for any help reagarding coding please mention the ENVIRONMENT and COMPILER you are using. Below link gives some hint: [url]http://www.codeproject.com/KB/GDI/fontnamefromfile.aspx[/url] | |
Re: > Hi! > I'm just starting to code in C, and I'm trying to read the information in a dat file, to then use it in some calculations. I read the information in the file and then save it in an array. However when I try later to access that … | |
Re: 'seq' may not work in all environments. Here is the code. [CODE] !#/bin/bash for((j=1;j<=1000;j++));do mkdir subdir_$j 2> /dev/null done [/CODE] to delete again: [CODE] !#/bin/bash for((j=1;j<=1000;j++));do rmdir subdir_$j 2> /dev/null done [/CODE] | |
Re: if u can do some manual work then 1)Open your Unicode file with notepad and save as ANSI. Then read that file it using C or else in DOS use command:[I]type filename > filename1[/I] Then read the filename1 using C ----------- If your want to develop a Unicode reading tool … | |
Re: here is the function which serves your purpose int string_pat_find(char *string1,char *patten); it take 2 arguments: 1st the char string 2nd the string to be found within and retuns the count occruance. Code attached below: [CODE=C] #include<stdio.h> #include<string.h> int string_pat_find(char *string1,char *patten); int main() { char string1[1000]="abcapplesarriveataplacethenifounditappleajajajajajajajajajaj"; char *letter[]={"apple","arrive","aj"}; int … | |
Re: Hello Dude, Here is the idea presented for you.work it by yourself and let me know in case of any issues. 1)initialize an array with charecters a-z. 2)use rand function with a modulo 26 to get the random charecters on the screen 3)use gotoxy() for the fall. 4)The letters falling … | |
Hi All, My requirement is like this.It a part of a software devlopment team as i am devloping a tool its a part of it. Its bit long but my explanation is clear to get it. 1)we need to read a data file using a description file. Usage: programname <description_file> … | |
Re: its the solution to your problem. [code] sort <filename>|grep '123_*'|uniq [/code] | |
Re: I do agree with TOM GUNN.Its a nice way to do things using structure. Still u can use simple variables. [CODE=C] int *a={2,3,4,5,6,7}; int no_of_variables=6; int value_to_match=2; int counter=0; for(i=0;i<no_of_variables;i++) { if(a[i]==value_to_match) counter++; printf("match variable is a_%d",i); } printf("Total mathch variales found is %d",counter); } [/CODE] NOTE: Here variable are … |
The End.