Code
// sa.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
#include <iostream>
using namespace std;
int main()
{
cin >> hello;
return 0;
}please what am i doing wrong here?
|
C
'cin' Isn't working |
(Aug 14, 2017 08:43 AM)CortexM4 Wrote: I know this is a troll but just in case it is not. Not a troll. I just started today and im taking it pretty seriously and not leaving anything out. I got like 3 books from my library lmao
Aug 14, 2017 08:48 AM
(This post was last modified: Aug 14, 2017 08:51 AM by Fυcĸleѕѕ.)
I also started learning C++ today. Found a recent free tutorial that is pretty good so far:
-snip- EDIT: I guess the site is considered Warez. How dated are the books you're using? (Aug 14, 2017 08:48 AM)Fυcĸleѕѕ Wrote: I also started learning C++ today. Found a recent tutorial that is pretty good so far: I dont know. There from a libary so probulary pretty old 2011.... :/ is that ok?
Aug 14, 2017 08:56 AM
(This post was last modified: Aug 14, 2017 08:59 AM by CortexM4.)
I would suggest learning C first.
Heres the classic one: https://github.com/germanoa/compiladores...nighan.pdf Proper ebook version: http://yunus.hacettepe.edu.tr/~yurdugul/3/C/c.pdf Once you learn C you will know how memory works and how to work with it, only then focus on C++ and all of it's advanced features. I also suggest you read this in parallel, it helps understanding the underlying architecture and how your code ends up executing on a computer. http://joe90.yolasite.com/resources/Insi...achine.pdf C++ is quite massive for a total beginner.
Aug 14, 2017 09:01 AM
(This post was last modified: Aug 14, 2017 09:02 AM by 0xDEAD10CC.)
How about reading the compiler warnings as a start? I'm pretty sure the error message for this one should be self-explanatory and won't be 100 lines like some other C++ errors.
Getting Started: C/C++
[C/C++/.NET/x86 ASM - Automation Programmer]
Aug 14, 2017 04:53 PM
(This post was last modified: Aug 14, 2017 04:54 PM by 0xDEAD10CC.)
(Aug 14, 2017 04:51 PM)Hapi Wrote: You might want to try initialise a variable before you try to use it. Keep learning because getting input for Strings is different than with numbers. It can be the same in terms of how input streams work and std::basic_string<char> (std::string). There's a limitation, but if it doesn't matter with the string value requirements, then you wouldn't be able to tell much of a difference.
Getting Started: C/C++
[C/C++/.NET/x86 ASM - Automation Programmer] (Aug 14, 2017 04:51 PM)Hapi Wrote: You might want to try initialise a variable before you try to use it. Keep learning because getting input for Strings is different than with numbers.Louka is that you? (Aug 15, 2017 07:38 AM)Zens Wrote: Exactly what this user said, you need to declare the integer first and then assign a value to it using cin evening chaps
Aug 15, 2017 09:17 AM
(This post was last modified: Aug 15, 2017 09:29 AM by 0xDEAD10CC.)
(Aug 15, 2017 07:38 AM)Zens Wrote: ... Why global?... Code #include "stdafx.h"
Getting Started: C/C++
[C/C++/.NET/x86 ASM - Automation Programmer] (Aug 15, 2017 09:17 AM)0xDEAD10CC Wrote: Why global?...In his defense, it's just an example, I'm sure that if OP put some time in to it he would learn proper programming practices. (Aug 15, 2017 09:31 AM)CortexM4 Wrote: In his defense, it's just an example, I'm sure that if OP put some time in to it he would learn proper programming practices. It's just as easy to provide him with good programming practices instead of assuming he will understand that what you're giving him isn't the best way to do things. Same amount of code, different scope/line.
Getting Started: C/C++
[C/C++/.NET/x86 ASM - Automation Programmer] |
|
|
| Possibly Related Threads... | |||
| Thread / Author | Replies | Views | Last Post |
| [C] by Quality_k1nGSep 27, 2018 07:05 PM | 6 | 292 |
Sep 27, 2018 07:05 PM Last Post: Quality_k1nG |
| [C] by F.A.S.TJul 22, 2018 10:57 AM | 1 | 119 |
Jul 22, 2018 10:57 AM Last Post: aeiro |
| [Java] by txkhaarOct 26, 2017 08:19 AM | 1 | 631 |
Oct 26, 2017 08:19 AM Last Post: XMR |