Click here to Skip to main content
15,889,898 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: Is it good practice for a beginner C++ coder to use autocomplete? Pin
Albert Holguin20-May-16 13:13
professionalAlbert Holguin20-May-16 13:13 
AnswerRe: Is it good practice for a beginner C++ coder to use autocomplete? Pin
Patrice T20-May-16 19:24
mvePatrice T20-May-16 19:24 
GeneralRe: Is it good practice for a beginner C++ coder to use autocomplete? Pin
Albert Holguin22-May-16 8:43
professionalAlbert Holguin22-May-16 8:43 
GeneralRe: Is it good practice for a beginner C++ coder to use autocomplete? Pin
Patrice T22-May-16 8:50
mvePatrice T22-May-16 8:50 
GeneralRe: Is it good practice for a beginner C++ coder to use autocomplete? Pin
Albert Holguin22-May-16 8:54
professionalAlbert Holguin22-May-16 8:54 
GeneralRe: Is it good practice for a beginner C++ coder to use autocomplete? Pin
Patrice T22-May-16 8:56
mvePatrice T22-May-16 8:56 
AnswerRe: Is it good practice for a beginner C++ coder to use autocomplete? Pin
Krishnakumartg21-Sep-16 19:38
Krishnakumartg21-Sep-16 19:38 
Questionc prgram to display a binary tree but it is not showing any output, what is the error in this program can you help me Pin
Member 1253604520-May-16 6:36
Member 1253604520-May-16 6:36 
C++
#include<stdlib.h>
#include<stdio.h>
struct tree
{
	char info;
	struct tree *left;
	struct tree *right;
};
struct tree *root;
struct tree *stree(struct tree *root,struct tree *r,char info);
void print_tree(struct tree *root,int l);
int main(void)
{
	char s[80];
	int l=3;
	root=NULL;
	do
	{
		printf("enter a letter:");
		gets(s);
		root=stree(root,root, *s);
		
	}
	while(*s);
	print_tree(root,0);
	return 0;
	
}
struct tree *stree(struct tree *root,struct tree *r,char info)
{
	if(!r)
	{
		r=(struct tree *) malloc(sizeof(struct tree));
		if(!r)
		{
			printf("out of memory \n");
			exit(0);
			
		}
		r->left=NULL;
		r->right=NULL;
		r->info=info;
		if(!root)
		return r;
		if(info<root->info)
		root->left=r;
		else
		root->right=r;
		return r;
		
	}
	if(info<r->info)
	stree(r,r->left,info);
	else
	stree(r,r->right,info);
	return root;
}
	void print_tree(struct tree *r,int l)
	{
		int i;
		if(!r) return ;
		print_tree(r->right,l+1);
		for(i=0;i<l;++i)
		printf(" ");
		printf("%c \n",r->info);
		print_tree(r->left,l+1);
		
	
}

AnswerRe: c prgram to display a binary tree but it is not showing any output, what is the error in this program can you help me Pin
Richard MacCutchan20-May-16 6:42
mveRichard MacCutchan20-May-16 6:42 
SuggestionRe: c prgram to display a binary tree but it is not showing any output, what is the error in this program can you help me Pin
David Crow20-May-16 8:13
David Crow20-May-16 8:13 
AnswerRe: c prgram to display a binary tree but it is not showing any output, what is the error in this program can you help me Pin
Patrice T20-May-16 15:45
mvePatrice T20-May-16 15:45 
QuestionCan someone simply explain defaulting arguments Pin
hakan8220-May-16 4:46
hakan8220-May-16 4:46 
AnswerRe: Can someone simply explain defaulting arguments Pin
David Crow20-May-16 4:49
David Crow20-May-16 4:49 
AnswerRe: Can someone simply explain defaulting arguments Pin
Albert Holguin20-May-16 13:17
professionalAlbert Holguin20-May-16 13:17 
QuestionDoes wp_cache still load Wordpress and use MySQL? Pin
Rostand5619-May-16 9:06
Rostand5619-May-16 9:06 
SuggestionRe: Does wp_cache still load Wordpress and use MySQL? Pin
David Crow19-May-16 9:16
David Crow19-May-16 9:16 
QuestionHow to pass Array[Seq[String]] to apache spark udf? (Error: Not Applicable) Pin
Rostand5619-May-16 9:04
Rostand5619-May-16 9:04 
QuestionRe: How to pass Array[Seq[String]] to apache spark udf? (Error: Not Applicable) Pin
David Crow19-May-16 9:15
David Crow19-May-16 9:15 
QuestionHow to organize nested props in VueJS? Pin
Rostand5619-May-16 9:03
Rostand5619-May-16 9:03 
SuggestionRe: How to organize nested props in VueJS? Pin
David Crow19-May-16 9:15
David Crow19-May-16 9:15 
GeneralRe: How to organize nested props in VueJS? Pin
Rostand5619-May-16 9:20
Rostand5619-May-16 9:20 
QuestionEdit Control Problem Pin
programmingalholic19-May-16 5:48
professionalprogrammingalholic19-May-16 5:48 
AnswerRe: Edit Control Problem Pin
Richard MacCutchan19-May-16 6:15
mveRichard MacCutchan19-May-16 6:15 
GeneralRe: Edit Control Problem Pin
programmingalholic19-May-16 6:47
professionalprogrammingalholic19-May-16 6:47 
GeneralRe: Edit Control Problem Pin
Richard MacCutchan19-May-16 7:01
mveRichard MacCutchan19-May-16 7:01 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.