id like to read a book explaining basics too, i saw let us c++ but the reviews stated that it was sh!t and gave wrong infoYou can try 'head first' series if you are aware of basic programing concepts.
thanks, is the book good for beginners? and what about the site? ill ask in some local shops...Buy this - C++ Primer book : Josee Lajoie, 8131775275, 9788131775271 - BookAdda.com India
Out of stock on Flipkart.
yup, the best book for beginners infact. It's a no nonsense book. Not a fancy one like Head First.thanks, is the book good for beginners? and what about the site? ill ask in some local shops...
ok thanks seems like the site has cod, ty againyup, the best book for beginners infact. It's a no nonsense book. Not a fancy one like Head First.
I think above is a thread that actually suits the content of the same. Programming is nothing but a set of commands created by a developer which is then coded into the machine so that the machine performs a set of tasks depending on user inputs or independently. such a fine post it is.
thanks, is the book good for beginners? and what about the site? ill ask in some local shops...
May i know the compiler ua using?if ua using linux interface u can have the copy of the program by following steps:Can any one tell me, how i can perform file operations copy, move in C??
What's the maximum number of if-else statements allowed in C++?
I didn't mean the if-else ladder. I just asked about the maximum number of uses of if-else in a program. I remember reading somewhere about the limit.if-else ladder you mean? the deepest level in an if-else ladder?
because, I think there may be a limit in the if-else ladder, but otherwise, there may be infinite number of uses of if-else...
#include<stdio.h>
#include<stdlib.h>
#include<string.h>
void main()
{
int num; char i=0,j; char a[11]={0,0,0,0,0,0,0,0,0,0,'\0'};
char string[11];
printf("\nEnter the decimal number\n"); scanf("%d",&num);
while(num>0)
{
a[i]=num%2;
i++;
num=num/2;
}
printf("\nThe Binary equivalent is\n");
for(j=9;j>=0;j--)
{
printf("%d",a[j]);
}
}
okay, a new question in here.
I want to convert a decimal number to binary and store it in a string so that I can use that binary output for later computation. Here is what I did
Code:#include<stdio.h> #include<stdlib.h> #include<string.h> void main() { int num; char i=0,j; char a[11]={0,0,0,0,0,0,0,0,0,0,'\0'}; char string[11]; printf("\nEnter the decimal number\n"); scanf("%d",&num); while(num>0) { a[i]=num%2; i++; num=num/2; } printf("\nThe Binary equivalent is\n"); for(j=9;j>=0;j--) { printf("%d",a[j]); } }
Now as you can see that all the binary output is in a[] but how do I get it into a string so that I can use printf("%s",string) and get the binary output ?
i am sorry , i am not getting your question..are you making threaded tree? coz you're saying you root node always has a pointer to it;[C++]
In a method, I have a pointer to a node, how do I set node to NULL using that pointer?
Also, can only use delete(), and not free().
Edit: Precisely, I need to delete root of tree, but when it's the last element, it doesn't work because tree's class always has a pointer to it.
Edit: In this root is accessible directly since it's in a friend class and I'm using iterative approach, so I just checked if it was root and a leaf and then set it to NULL.