- Strength to Increase Rep
- +0
- Strength to Decrease Rep
- -0
- Upvotes Received
- 7
- Posts with Upvotes
- 7
- Upvoting Members
- 5
- Downvotes Received
- 3
- Posts with Downvotes
- 3
- Downvoting Members
- 2
14 Posted Topics
Re: Please use gets() instead of scanf() if you expect spaces in the user input. scanf() does not handle spaces the way you want it to work. | |
Re: Declaring such a big array on stack (by declaring it inside a function) would probably cause stack overflow issues. If you know pointers you should declare a [icode]double **tree[/icode] inside main function (where you are defining [icode]double tree[DIM][DIM][/icode]) and allocate memory dynamically using malloc() or something similar. This way you … | |
Re: [QUOTE=ahp@aol.in;1152033]Thank you very much. but what is meaning of that error: '++ needs l-value'[/QUOTE] Compiler messages can be funny sometimes. You really have to look at the code closely to figure out why it is saying so. I guess here the compiler is actually not able to change the value … | |
Re: If you are confused about the following line, don't be. All of us including the compiler should be confused about it since it has syntax error and the comments don't match either [icode] big[big][2][2]...big[2][2]. = 177; /* this is big[5][5] = 177; */ [/icode] :) On more serious note let's … | |
Re: Just looking at it with a glance, you have your const int defined at wrong location. Is it compiling? You need to define them before you declare your array. Will take a look at the sorting. | |
Re: [QUOTE=Morrac;1151530] The only problems are that 1) I am getting caught when trying to get the process ID ... [/QUOTE] Can you explain what you meant by getting caught? | |
Re: you will have to initialize i in your for loop to the length of the string entered. To get the length of the string entered, use the strlen() function. [icode] for (i=strlen(array1)-1; i>=0; i--) [/icode] If you have something else defined in your simpleio.h that returns the length of the … | |
Re: Here is a good brief reference to strcat() [url]http://www.cplusplus.com/reference/clibrary/cstring/strcat/[/url] and here is one for strcmp() [url]http://www.cplusplus.com/reference/clibrary/cstring/strcmp/[/url] | |
Re: Simplify your work. First ignore the spaces to simplify your problems. First loop - say i - for each line so it runs from 0 to n-1 Inside this loop { First loop - j - goes from i to (2*i - 1) - print each j Second loop (not … | |
Re: There is recursion in your count_a_fnc() function (it is calling itself) with no base case. Did you really want to do that? All you need to do is to read one char at a time just like your print_vowels_fnc() function and instead of checking for vowels, check for 'a', and … | |
Re: Hi Xufyan: The body of a loop starts from { and ends at }. If you look at your examples you have what we call nested loops - loop inside loop. In both of your examples there is an internal loop inside an external loop. [B]1st question:[/B] For every value … | |
Re: You first while loop is wierd. You should not be moving head at all. You should only be moving current and prev. | |
Re: Your storeId field is defined to be only 3 chars in the struct, whereas your values (strings) are also 3 chars and there is no space allocated for the '\0' (end of string) character. This results in end of string character overflowing into the next field in the switch statement … |
The End.