C/C++ Beginner's Guide and Post Basic Questions here

vickybat

I am the night...I am...
There's a difference between a noob programmer and a starter programmer. One is acquainted enough but unclear, one is in complete darkness. Head first C is a but high level for latter.


Ok i'm starting to get what you're trying to put here. But i don't think head first c is that much complicated for beginners.
I mean its fairly simply and easy to understand than books i stated in my previous post. I would even go on to say that the book is even simpler than Dennis Ritchie's "The C Programming language", the creator of C.

So you have any better suggestion here for newbies?
 

dashing.sujay

Moving
Staff member
Ok i'm starting to get what you're trying to put here. But i don't think head first c is that much complicated for beginners.
I mean its fairly simply and easy to understand than books i stated in my previous post. I would even go on to say that the book is even simpler than Dennis Ritchie's "The C Programming language", the creator of C.

So you have any better suggestion here for newbies?

Well I couldn't find a book as good as head first C. It is simple, but only for those, who know even a bit of programming, or have good born-grasping of programming. I'm saying this as I've tested this personally on some of my friends. It may differ for others. :)
 

krishnandu.sarkar

Simply a DIGITian
Staff member
Well yeah, Head First C is not for starters. It for programmers who atleast know what programming is.

For those type of readers, I suggest Head First Programming and then Head First C.

Head First Programming introduces programming language concepts with Python, which is the best language for starters (in my and various other members opinion).

See, there's no point in learning a language if you can't cover the tricks. C has many tricks and the main tricks lies on pointer and structure (we all know that). HFC makes those areas clear by keeping the base strong.

So no point in learning C first.

Finally..
1. If anyone have previous programming experience go for Head First C.
2. If not, then get Head First Programming and move to Head First C.
 
Well yeah, Head First C is not for starters. It for programmers who atleast know what programming is.

For those type of readers, I suggest Head First Programming and then Head First C.

Head First Programming introduces programming language concepts with Python, which is the best language for starters (in my and various other members opinion).

See, there's no point in learning a language if you can't cover the tricks. C has many tricks and the main tricks lies on pointer and structure (we all know that). HFC makes those areas clear by keeping the base strong.

So no point in learning C first.

Finally..
1. If anyone have previous programming experience go for Head First C.
2. If not, then get Head First Programming and move to Head First C.

Since I am a complete :noob: I'm going for head first programming.

Well yeah, Head First C is not for starters. It for programmers who atleast know what programming is.

For those type of readers, I suggest Head First Programming and then Head First C.

Head First Programming introduces programming language concepts with Python, which is the best language for starters (in my and various other members opinion).

See, there's no point in learning a language if you can't cover the tricks. C has many tricks and the main tricks lies on pointer and structure (we all know that). HFC makes those areas clear by keeping the base strong.

So no point in learning C first.

Finally..
1. If anyone have previous programming experience go for Head First C.
2. If not, then get Head First Programming and move to Head First C.

Since I am a complete :noob: I'm going for head first programming.
 

Desmond

Destroy Erase Improve
Staff member
Admin
Learn BASIC first to get programming fundamentals right. There are many online BASIC interpreters to get you started or you can find GWBASIC and run it on Dosbox.
 

Vyom

The Power of x480
Staff member
Admin
^^ Basic is not at all necessary even if you are a complete noob in programming! :|
 

mitraark

Decrepit
Learn BASIC first to get programming fundamentals right. There are many online BASIC interpreters to get you started or you can find GWBASIC and run it on Dosbox.

I understand what you are trying to say, BASIC probably has the most similarities with real world languages, but BASIC is defunt now, you can start with Python though, although i believe one should have the sense to grasp C fundamentals from the beginning.
 

Desmond

Destroy Erase Improve
Staff member
Admin
BASIC might be defunct but I am suggesting to learn its fundamentals. It's the easiest language I know, therefore very appropriate for utter noobs to get a grasp of programming. I would suggest python next.

PS: BASIC is not as defunct as you think. Visual Basic uses a syntax similar to Basic.

Edit: Indeed one should have some fundamentals in C since it is still relevant in low level coding and embedded systems programming.
 
Can someone please explain me these programs ??

#include<stdio.h>
void main()
{
int i=5, j;
j=++i+(++i)+(++i);
printf("%d %d",i, j);
}
Can someone explain why j=22 ? I'm clear about i=8....

#include<stdio.h>
void main()
{
int n; // assuming int to be 32 bit long
printf("Enter a number : ");
scanf("%d", &n);
//shift it right 31 times so that MSB comes to LSB's position
//and then and it with 0x1
if ((n>>31) & 0x1 == 1) {
printf("Negative number\n");
} else {
printf("Positive number\n");
}
}
This one checks if a number is positive or negative. What is 0x1 == 1 ?
 
You're initiating j from garbage value, which is a bad programming practice, that's why the wrong result. Try with j =0.

So what ? Answer will be same if I initialize "j" with garbage value or user defined value........ I'm not a noob

I can't get your second program though. If you want to check a number if it's positive or not, then it's very easy.

I want to check it without using relational & conditional operators i.e. like using if(n<0) printf(.....)
 

nims11

BIOS Terminator
Can someone please explain me these programs ??

This one checks if a number is positive or negative. What is 0x1 == 1 ?

For a 32 bit signed integer, the 32nd bit denotes the sign, so (n>>31)&1 is 1 if the number is negative(i.e. the sign bit is set)
 

reddick

Mobile Freak
Hi Friends!

I want to learn basic programming but I have done B.A only. So Is it necessary to pursue B.Tech (Computer Science) for learning programming. Actually I did not know the basics though that is Difference between Programmers and Developers? How to make Applications? About JavaScript, C or C++ etc.?
Please suggest me any books or links so that I can learn and practice all this at home...Thanks a lot :)

P.S - I have downloaded Notepad++ today :rolleyes:
 
Hi Friends!

I want to learn basic programming but I have done B.A only. So Is it necessary to pursue B.Tech (Computer Science) for learning programming. Actually I did not know the basics though that is Difference between Programmers and Developers? How to make Applications? About JavaScript, C or C++ etc.?
Please suggest me any books or links so that I can learn and practice all this at home...Thanks a lot :)

P.S - I have downloaded Notepad++ today :rolleyes:

> B.Tech. is not at all required for learning programming. Besides, if you join some average college, the only things you'll learn are college's map, authors of various books, which teacher knows what, and a few other useless stuff.

> Programmer is one who codes. He eats code, he shits code, he walks code, he talks code, he lives in code. Programmer is one who knows how to code, ALONG with how to design a good UI, how to organize a project, and basically everything related to creation of a software. According to Time magazine, Software Engineering is the number 1 job as per pay-per-stress levels. there are many many other stuffs than coding in SE.

> To create an application, you need a paper, a pen, and you need to know the applications format. Just kiding :p you must know some programming language for that. Start with c, then progress to c++ -> Java -> c#

> Herbert Schidlt is my personal favourite for C++ and Java for begineers.

> Congratulations, now you can edit text files in a WHOLE NEW app!!! :clap:


BTW why do you want to go into programming?
 

reddick

Mobile Freak
Actually I or we all use computer techniques or related stuff in our daily life like - internet, android, e-mail, etc. So I just want to know the basic structure of this world and Secondly this field would develop more and more in coming yrs. So I think I have to learn the broad and only important areas just to increase my general knowledge :idea:
 

nightcrawler

Broken In
I suggest you grab a good C/C++ book out there. Get a free C/C++ compiler and start coding on your own. That is how I learnt it. Although I am an Engineer, the Engineering syllabus or the teaching here in India is very poor. Most of the engineers out there (I am talking about Computer & IT) do not know how to write simple programs and get their way through by way of mugging. So if you want to learn you don't need to be an engineer :)

Take it from there and see how things go. Slowly start solving various programming puzzles that you might find across various sites. Just google it, you will find tonnes of them. Get your programming basic fundamentals to the T though. It will help you a lot as you move across various other languages.

Also it is more of developing a programming approach, language does not matter much. Yes you will be able to do certain things more easily in one language over the other, but then each language was designed for a specific purpose and will suite better for that purpose obviously. Although once your fundamentals are in place, all that you need to learn is syntax and rules of the new language that you will be using to code.

Hope this helps
 
Last edited:

saswat23

Human Spambot
Explain me the output of this:

Code:
void main()
{
float a=1.22; 
if (a==1.22) 
printf("C");
else 
printf("cD");
getch();
}
 
Top Bottom