Click here to Skip to main content
15,507,171 members
Home / Discussions / Managed C++/CLI
   

Managed C++/CLI

 
AnswerRe: Is every C# feature available in C++/Managed ? Pin
Richard MacCutchan11-Oct-17 10:50
mveRichard MacCutchan11-Oct-17 10:50 
AnswerRe: Is every C# feature available in C++/Managed ? Pin
John Schroedl28-Nov-17 3:03
professionalJohn Schroedl28-Nov-17 3:03 
Questionc++ Pin
Member 1340521911-Sep-17 22:51
Member 1340521911-Sep-17 22:51 
AnswerRe: c++ Pin
Jochen Arndt11-Sep-17 23:41
professionalJochen Arndt11-Sep-17 23:41 
QuestionGet USB drive letter Pin
Member 101933363-Aug-17 1:22
Member 101933363-Aug-17 1:22 
SuggestionRe: Get USB drive letter Pin
Jochen Arndt3-Aug-17 2:10
professionalJochen Arndt3-Aug-17 2:10 
GeneralRe: Get USB drive letter Pin
Member 101933363-Aug-17 3:31
Member 101933363-Aug-17 3:31 
GeneralRe: Get USB drive letter Pin
Jochen Arndt3-Aug-17 3:34
professionalJochen Arndt3-Aug-17 3:34 
GeneralRe: Get USB drive letter Pin
Member 101933363-Aug-17 3:32
Member 101933363-Aug-17 3:32 
GeneralRe: Get USB drive letter Pin
Richard MacCutchan3-Aug-17 3:38
mveRichard MacCutchan3-Aug-17 3:38 
GeneralRe: Get USB drive letter Pin
Member 101933363-Aug-17 3:43
Member 101933363-Aug-17 3:43 
GeneralRe: Get USB drive letter Pin
Jochen Arndt3-Aug-17 3:43
professionalJochen Arndt3-Aug-17 3:43 
Questionsingly linked list Pin
Member 1306030218-Jul-17 0:27
Member 1306030218-Jul-17 0:27 
AnswerRe: singly linked list Pin
Richard MacCutchan18-Jul-17 3:10
mveRichard MacCutchan18-Jul-17 3:10 
GeneralRe: singly linked list Pin
Member 1306030218-Jul-17 16:14
Member 1306030218-Jul-17 16:14 
thank you for your reply..

this is the code in klien.c
#include <stdio.h>
#include <stdlib.h>
#include "list.h"

int main(int argc, char *argv[]){
	List L = NULL;
	Position P = NULL;

	L = Construct(L);
	P = Header(L);
	
int i, n, *element;
	printf("Entri element: ");
	scanf("%d", &n);
	element = (int*)malloc(n*sizeof(int));
	for(i =0; i<n; i++){
		printf("Entri element[%d]: ", i);
		scanf("%d", &element[i]);
		Insert(element[i], L, P);
		P = Advance(P);
	}
	printf("\n");
	getLargestElement(L);
	

	return 0;
}

this is the code in list.h
typedef int ElementType;
#ifndef _List_H
#define _List_H

struct Node;
typedef struct Node *PtrToNode;
typedef PtrToNode List;
typedef PtrToNode Position;

List Construct(List L);
Position Header(List L);
void Insert(ElementType X, List L, Position P);
int IsLast(Position P, List L);
Position Advance(Position P);
Position getLargestElement(List L);
int IsEmpty(List L);
#endif


and the last in list.c
#include <stdio.h>
#include <stdlib.h>
#include "list.h"

struct Node{
	ElementType Element;
	Position Next;
};

List Construct(List L){
	L = malloc(sizeof(struct Node));
	if(L==NULL) 
	printf("Memori Kosong dan Tidak Dapat Dialokasi");
	L->Next = NULL;
	return L;
}
Position Header(List L){
	return L;
}

void Insert(ElementType X, List L, Position P){
	Position TmpCell = NULL;	
	TmpCell = malloc(sizeof(struct Node));
	if(TmpCell == NULL) printf("Memori Kosong dan Tidak Dapat Dialokasi");
	TmpCell->Element = X;
	TmpCell->Next = P->Next;
	P->Next = TmpCell;
}


int IsLast(Position P, List L){
	return P->Next == NULL; 
}


Position Advance(Position P){
	return P->Next;
}

int IsEmpty(List L){
	return L->Next == NULL;
}

Position getLargestElement (List L){
	ElementType Largest;
	Position P;
	if(!IsEmpty(L)){
		P = L->Next;
		Largest = P->Element;
		while(!IsLast(P, L)){
			P = P->Next;
			if(P->Element > Largest){
				Largest = P->Element;
			}
			
		}
		printf("element terbesar  adalah: %d\n",Largest);	
	}
	else{
		printf("tidak ada  ");
	}
	return 0;
}


and my problem is i dont know how to make a splitlist function in my email before..
thank you
GeneralRe: singly linked list Pin
Richard MacCutchan18-Jul-17 21:43
mveRichard MacCutchan18-Jul-17 21:43 
GeneralRe: singly linked list Pin
Member 1306030218-Jul-17 22:13
Member 1306030218-Jul-17 22:13 
GeneralRe: singly linked list Pin
Richard MacCutchan18-Jul-17 22:41
mveRichard MacCutchan18-Jul-17 22:41 
GeneralRe: singly linked list Pin
Member 1306030218-Jul-17 22:45
Member 1306030218-Jul-17 22:45 
QuestionStuck with one program. Pin
B.Sudhir25-Jun-17 17:58
B.Sudhir25-Jun-17 17:58 
AnswerRe: Stuck with one program. Pin
Jochen Arndt25-Jun-17 22:40
professionalJochen Arndt25-Jun-17 22:40 
GeneralRe: Stuck with one program. Pin
B.Sudhir25-Jun-17 23:14
B.Sudhir25-Jun-17 23:14 
GeneralRe: Stuck with one program. Pin
Member 1496952719-Oct-20 8:29
Member 1496952719-Oct-20 8:29 
AnswerRe: Stuck with one program. Pin
Artur Linov IT25-Jul-17 7:43
Artur Linov IT25-Jul-17 7:43 
AnswerRe: Stuck with one program. Pin
Member 1496952719-Oct-20 8:04
Member 1496952719-Oct-20 8:04 

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.