73 Posted Topics
Re: scanf_s is some kind of secure version of scanf... its available in msdn... | |
Re: Strings are passed by reference by default... atoi-> Like salem said error handling is bit tough... sscanf-> is what i would have used, it would separate as well as convert it to int format(or what ever format)... strtol->Parses the C string str interpreting its content as an integral number of … | |
Re: Hi, There are standard functions for all the ones you have said above... check out math.h... What kind of idea are you expecting anyways?... For add, you need to have atleast 2 numbers... take number 1, take number 2, add them... thats all... Be specific about what you want... | |
Re: Hi, Please be more specific... First of all, use code tags when you put up the code... Secondly, whats the actual issue?... Did you mean it runs only once even if you select Sign Up? or is it taking only Username and Password? Tips : Clear the input buffer before … | |
Re: Nope this loop doesn't go to infinity... For positive and negative value of both i and j, it will not even enter the loop... if either i or j is negative, it will enter the loop once... thats it... | |
Re: Hi, Its all done wrong, have given the comments inside... [code=c] #include <stdio.h> /*Include the standard I/0 header file */ #include <string.h> /*Include the standard I/0 header file string library */ //The functions that are meant to be defined char* toPLString(char * inputstring); int getInputBygetChar(char input[]); int getInputByfgets(char input[]); int … | |
Re: [QUOTE=Salem;707712]Here's another redirection [url]http://cboard.cprogramming.com/showthread.php?t=107852[/url][/QUOTE] That Rocked!!! | |
Re: Hi, Please be more specific... What is it that you are looking for? If you want the program to prompt the user to enter the Standing charger and Rate per unit, then you can do it just the way you are taking previous and present readings. | |
Hi Everyone, I know conio.h is not available in Unix. I want to use getch(). Using curses.h needs causes the screen to clear which I don't want. I found a code snippet (source : internet) using termios, it works, the thing is I need to press enter/or any other key … | |
Re: Hi there, [code] for (i=0;i<=2;i++){ fflush(stdin); scanf("%d %c %c %c %d",&d2[i].roll,&d2[i].name,&d2[i].dep,&d2[i].course,&d2[i].year); } [/code] Just add fflush(stdin) inside the for loop... this will solve your problem... To remember : Always use fflush(stdin) before scanf() cause if not done, the input which you have given will remain in the input stream and … | |
Hi All, Is there any way to invoke an Window Application (for eg say calc.exe) from a Unix Server. I think we might be needing a Windows X Server running. I am not sure how to invoke an application from the unix server. Any help on this. Regards, Ahamed. | |
Re: Hi there, Please try to be more specific about your queries... Looks like this is a doubly linked list... a queue?... Like Sci@phy said, if h is a pointer to first node, you should use [code] if(h == NULL) [/code] or if it is an argument you have passed to … | |
Re: Here it is... [code] #include "stdio.h" #include "conio.h" int fact (int n); // function prototype// int main (void) { int n,result; printf("please enter a positive integer"); scanf("%d", &n); result = fact(n); printf("The answer is %d\n", result); getch(); return 0; } int fact (int n) { if (n<=1) return 1; else … | |
Re: Hi, If its ok the character is echoed on the screen, you can very well go for getc(stdin) or getchar() in a while loop with the termminating condition like carriage return or something you want... | |
Re: Hi there, Other than the syntax error, there is no issue with the logic... Below I am pasting the correct code with a print statement... [code] #include "conio.h" #include "stdio.h" int fib (int n); // function prototype// int main (void) { int num, result; printf ("Please enter a positive integer\n"); … | |
Re: Hi, I am not able to run the program in Windows using Eclipse, it give me error... To get more info on core file, comile your sources with -g option like cc P3.c -c -g P3.o and then when the core is generated run the command gdb a.out core It … | |
Hi everyone, Need a small help. I need to read the data from stdin (standard input) without hitting enter. Need to read the data as in and when they are typed in until EOF (CTRL + D as I am using UNIX) is encountered. I tried, getc() - requires ENTER … | |
Re: conio.h is not supported in Unix C. Are you using Unix C? You must be using conio.h probably for getch() I guess, if so you may use getchar(). | |
Re: Guys guys... this ain't a homework solving forum... come on... are you stuck with some coding part?, then we will help you, gladly... but don;t expect us to do your homework... the algorithm you need to solve your problem is given by Salem... so please... put in some effort... | |
Re: Can you please elaborate.... I didn't get you actually... | |
Re: hey, you are missing a semi-colon in [code] if (*ptr == ' ') spaces++; [/code] Hope it will work now. | |
Re: You learn C, you will master 70% of programming languages. I have attached a C tutorial pdf for getting started. Hope it will be helpful. I strongly recommend to try out the programs and not just reading through. You may download Dev-cpp from bloodshed.net for an C IDE. All the … |
The End.