Click here to Skip to main content
15,888,579 members
Home / Discussions / C#
   

C#

 
GeneralRe: Interview Pin
CWIZO13-Feb-04 1:45
CWIZO13-Feb-04 1:45 
QuestionnumericUpDown Control - double digits? Pin
KingTermite12-Feb-04 17:07
KingTermite12-Feb-04 17:07 
AnswerRe: numericUpDown Control - double digits? Pin
Anonymous12-Feb-04 18:43
Anonymous12-Feb-04 18:43 
AnswerRe: numericUpDown Control - double digits? Pin
Heath Stewart13-Feb-04 3:36
protectorHeath Stewart13-Feb-04 3:36 
GeneralRe: numericUpDown Control - double digits? Pin
KingTermite13-Feb-04 3:43
KingTermite13-Feb-04 3:43 
GeneralRe: numericUpDown Control - double digits? Pin
Heath Stewart13-Feb-04 3:56
protectorHeath Stewart13-Feb-04 3:56 
GeneralRe: numericUpDown Control - double digits? Pin
KingTermite13-Feb-04 4:22
KingTermite13-Feb-04 4:22 
GeneralNeed help with pointers Pin
Anonymous12-Feb-04 16:12
Anonymous12-Feb-04 16:12 
#include <stdio.h><br />
#include <stdlib.h><br />
#include <string.h><br />
<br />
typedef struct<br />
{<br />
	char *item[100];<br />
	int top;<br />
}strstk, *strstkptr;<br />
<br />
char *chartostr(char);<br />
char *process(strstkptr);<br />
char *pop(strstkptr);<br />
void push(strstkptr, char *);<br />
<br />
int main()<br />
{<br />
	strstkptr pS=(strstkptr)malloc(sizeof(strstk));<br />
	char *p;<br />
	char buf[100];<br />
	char *pV;<br />
<br />
	while(scanf("%s", buf) !=EOF){<br />
		switch(buf[0]){<br />
		case '(':<br />
		case '+':<br />
		case '*':<br />
			p=chartostr(buf[0]);<br />
			push(pS, p);<br />
			break;<br />
		case ')':<br />
			pV=process(pS);<br />
			if(pS->top==0)<br />
				printf("%s ", pV);<br />
			else<br />
				p=malloc(100);<br />
				sprintf(p,"%d", pV);<br />
				push(pS, pV);<br />
			break;<br />
		default:<br />
			break;<br />
		}<br />
	}<br />
<br />
}<br />
<br />
char *pop(strstkptr pS)<br />
{<br />
	return pS->item[--pS->top];<br />
}<br />
<br />
void push(strstkptr pS, char *pV)<br />
{<br />
	pS->item[pS->top++]=pV;<br />
}<br />
<br />
char *process(strstkptr pS)<br />
{<br />
	char *p, *py, *px;<br />
<br />
	while((p=pop(pS)) != "("){<br />
		if(p="*"){<br />
			py=pop(pS);<br />
			px=pop(pS);<br />
<br />
			//need to return digit<br />
		}<br />
		else<br />
			py=pop(pS);<br />
			px=pop(pS);<br />
<br />
			//need to return digit<br />
<br />
		<br />
	}	<br />
}<br />
<br />
char *chartostr(char ch)<br />
{<br />
	char *p=malloc(2);<br />
	p[0]=ch;<br />
	p[1]=0;<br />
	return p;<br />
}<br />


I don't know know how I'm supposed to to add or multiply from my stack can anybody help
GeneralRe: Need help with pointers Pin
Nick Seng12-Feb-04 21:40
Nick Seng12-Feb-04 21:40 
Generalconverting a string to an int Pin
Talal Sultan12-Feb-04 13:38
Talal Sultan12-Feb-04 13:38 
GeneralRe: converting a string to an int Pin
Nicholas Naddaf12-Feb-04 14:20
Nicholas Naddaf12-Feb-04 14:20 
GeneralRe: converting a string to an int Pin
Uwe Keim12-Feb-04 20:34
sitebuilderUwe Keim12-Feb-04 20:34 
GeneralRe: converting a string to an int Pin
Talal Sultan12-Feb-04 23:28
Talal Sultan12-Feb-04 23:28 
Generalcombining multiple crystal reports in one pdf file Pin
Visionsoft12-Feb-04 11:38
Visionsoft12-Feb-04 11:38 
QuestionLISTVIEW C# : Blinking a row ? Pin
youssef12-Feb-04 11:01
youssef12-Feb-04 11:01 
AnswerRe: LISTVIEW C# : Blinking a row ? Pin
Heath Stewart12-Feb-04 11:37
protectorHeath Stewart12-Feb-04 11:37 
GeneralWrapping Outlook's database... Pin
profoundwhispers12-Feb-04 10:53
profoundwhispers12-Feb-04 10:53 
GeneralRe: Wrapping Outlook's database... Pin
Heath Stewart12-Feb-04 11:31
protectorHeath Stewart12-Feb-04 11:31 
GeneralRe: Wrapping Outlook's database... Pin
profoundwhispers12-Feb-04 11:49
profoundwhispers12-Feb-04 11:49 
GeneralRe: Wrapping Outlook's database... Pin
Heath Stewart12-Feb-04 12:03
protectorHeath Stewart12-Feb-04 12:03 
GeneralListView Pin
Gary Kirkham12-Feb-04 10:20
Gary Kirkham12-Feb-04 10:20 
GeneralRe: ListView Pin
Heath Stewart12-Feb-04 11:15
protectorHeath Stewart12-Feb-04 11:15 
GeneralRe: ListView Pin
Gary Kirkham12-Feb-04 13:46
Gary Kirkham12-Feb-04 13:46 
GeneralRe: ListView Pin
Heath Stewart12-Feb-04 15:37
protectorHeath Stewart12-Feb-04 15:37 
GeneralCustom scrolling on control Pin
Judah Gabriel Himango12-Feb-04 10:00
sponsorJudah Gabriel Himango12-Feb-04 10:00 

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.