I am learning C from a book, and I don't seem to understand fully the following paragraphs about arrays and pointers:
Although many similarities exist between pointers and arrays, they have one...
Type: Posts; User: James00
I am learning C from a book, and I don't seem to understand fully the following paragraphs about arrays and pointers:
Although many similarities exist between pointers and arrays, they have one...
Glad that I could help you out 4play!!! :D Anyway, I really recommend that you visit here often, and ask for help here when needed, it really is a great forum with lots of guys with a lot of...
Try this out:
#include <stdio.h>
#include <conio.h>
#include <string.h>
#include <stdlib.h>
#include <ctype.h> //you need this for the tolower function
int main () //start with...
First of all, good to see that you know more than I thought, now I can explain things to you much easier! Now, let me put it this way, you only declare the number of characters (as in char name[20];...
Ok I will post a simple program where you declare a char variable and the user types his name (his name becomes the variable). Here it is (type in your editor and post it):
#include <stdio.h>
...
You could use both methods you have described above, but there is also another way (actually, many more, but to advanced right now) to give a value to a char variable, and I explained it in my last...
Glad to hear that I was able to help you out! :D Anyway, I'll try and explain each question you have as easy as I possibly can.
As quzah said it should be able to work. What I think happened...
Yeah, but he still he understood everything differently, judging by his posts, he thinks that a char is a way to put a number in program by using a 'letter' (example: a) to specify a certain number,...
Yeah I understand what you mean, but let me explain. I have only started learning C a couple of months ago (in a sense I am also a beginner), and that is how I learned about the char variable, and I...
I think that Tride wants you to explain it in simpler terms, he is a beginner after all, and frankly, I think your answers are too complicated for him (you are using loops and arrays, and he still...
As XSquared said you need to put break; at the end of 'case 1' in order to prevent the 'default' statement to run if 'case 1' is correct. If you don't put it, then if 'case 1' is correct, also the...
You could use the strlen function (remember to put the string.h header file) to read the number of characters. Example:
#include <stdio.h>
#include <string.h>
int main()
{
char...
I have looked at the help files but I can't really find what I am looking. What I do is this: I open the only possible folder in the help menu, Command Line Tools. Then I get all these C++ Builder...
Well, I have tried a lot of things and none work, but then I noticed that my compiler compiled by deafult in 32 bit, and my programs only runs in 16 bit. How do I make my compiler compile in 16 bit?...
Thanks for all the help!!! I actually save my source code with the .c at the end instead of .cpp. And thanks for the comments about void main(), I will use int from now on. I think I will have to get...
I use Borland C++ Compiler 5.5,which runs in DOS, I just put bcc32 and the source code (the .cpp file that has source code) and it compiles it. Well I am having the following problem while trying to...
Thanks a lot!!! Hammer, your guide is awesome, I now know exactly what each function is. A million thanks!!! :D
I have a question, whats the difference between (1) using atoi to convert a 'char number' (number used in a char variable) into a int variable , (2) and just using scanf to read the int directly...
Thanks!!! Anyway, why don't I need the 'atoi' statement? I have a 'char' and I want to convert it to a 'int'. Could you please explain why I don't need the 'atoi' in this program. Thanks.
I have started learning C a couple of weeks ago, but I have the following question. Any 'char' variables can hold string values and numeric valued from -128 to 127. If it is unsigned it can hold...