using namespace std;
cout<<"Enter your name.\n";
cin >> name;
cout<<"Hello, " << name;
this is what I have..
Very simple program but I cannot get it to work, as soon as I enter two or more letters when debugging, the cmd crashes. I think it is because I am using char instead of another kind of variable, but i dont know what else to use! Please help. Thanks
A char is for a single character meaning if you type in "Hello" it will only save the 'H' to the char variable.
You can make a char array char myarray[size]; This will be able to hold as many characters in it as you have "size".
Or you can include the string header. #include <string> A string is similar to a character array but you do not have to specify the size of it upon declaration. string mystring; I would go check out this website for learning the basics of C++ it helped me out. here.
This array of chars (also known as a C-String) will provide you with 79 available char-containers in which ye' can populate with ascii characters. Remember, with c-strings to always make sure you have a '\0' NULL terminator somewhere in your array. Also, be sure to become familiar with the <cstring> library of functions that will make your life easier.
Need some help with this Array. I am trying to get the sum of the even numbers and the sum of the odd numbers using a for each loop. I know the answers to what I am trying to achive are sum of even = 84 and the sum of ...
I have a 2d matrix with dimension (3, n) called A, I want to calculate the normalization and cross product of two arrays (b,z) (see the code please) for each column (for the first column, then the second one and so on).
the function that I created to find the ...