Click here to Skip to main content
15,888,610 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: char buf Pin
benjymous11-Jan-06 7:30
benjymous11-Jan-06 7:30 
GeneralRe: char buf Pin
Eytukan11-Jan-06 3:43
Eytukan11-Jan-06 3:43 
AnswerRe: char buf Pin
Nish Nishant11-Jan-06 3:59
sitebuilderNish Nishant11-Jan-06 3:59 
AnswerRe: char buf Pin
vipinasda11-Jan-06 4:43
vipinasda11-Jan-06 4:43 
AnswerRe: char buf Pin
lemur211-Jan-06 4:50
lemur211-Jan-06 4:50 
GeneralRe: char buf Pin
Sebastian Schneider11-Jan-06 5:12
Sebastian Schneider11-Jan-06 5:12 
AnswerRe: char buf Pin
Sebastian Schneider11-Jan-06 5:10
Sebastian Schneider11-Jan-06 5:10 
AnswerAnswer!! Pin
Eytukan11-Jan-06 5:25
Eytukan11-Jan-06 5:25 
not fully structured.. i typed just like that...
typedef struct node 
{
	char chr;
	int index;
	struct node* nChr;
}chatSet_t;

char *makeString(struct node* Start,int size)
{
int j=0;
  struct node* newStr =Start;

  char *myString =new char(size); 

  while(j<size)
  {
	myString[j]=newStr->chr;
	newStr=newStr->nChr;
	j++;
  }
	myString[size]='\0';	
  return(&myString[0]);
}


int main(int argc, char* argv[])
{
	
char *actualString;
struct node* head = new (node);
struct node* newString = new (node);

int i=0;
head=newString;
char x;
do
{
	x = getchar();
	newString->chr =x;
	newString->index =i;
	newString->nChr =new(node);
	newString=newString->nChr;
	i++;
}while(x!=10);

actualString = makeString(head,i);
printf("\n%s",actualString);

getch();

	return 0;
}

i did it.. but just not error proof Smile | :)




0x0400:
"But your mind is very complex, very tricky. It makes simple things complicated. -- that's its work. And for centuries it has been trained for only one thing: to make things so complicated that your life becomes impossible."- Osho

<marquee scrollamount="1" scrolldelay="1" direction="up" height="10" step="1">--[V]--


AnswerRe: char buf Pin
Bob Stanneveld11-Jan-06 10:31
Bob Stanneveld11-Jan-06 10:31 
GeneralRe: char buf Pin
Tim Smith11-Jan-06 11:52
Tim Smith11-Jan-06 11:52 
GeneralRe: char buf Pin
Bob Stanneveld12-Jan-06 22:19
Bob Stanneveld12-Jan-06 22:19 
AnswerRe: char buf Pin
Stephen Hewitt11-Jan-06 15:34
Stephen Hewitt11-Jan-06 15:34 
QuestionPermissions and fopen Pin
Chris Meech11-Jan-06 3:02
Chris Meech11-Jan-06 3:02 
AnswerRe: Permissions and fopen Pin
vipinasda11-Jan-06 4:53
vipinasda11-Jan-06 4:53 
GeneralRe: Permissions and fopen Pin
Chris Meech11-Jan-06 6:17
Chris Meech11-Jan-06 6:17 
GeneralRe: Permissions and fopen Pin
__yb11-Jan-06 11:36
__yb11-Jan-06 11:36 
GeneralRe: Permissions and fopen Pin
vipinasda11-Jan-06 16:23
vipinasda11-Jan-06 16:23 
GeneralRe: Permissions and fopen Pin
__yb11-Jan-06 23:52
__yb11-Jan-06 23:52 
QuestionON_NOTIFY_RANGE and Textbox's KillFocus Pin
Sarvan AL11-Jan-06 2:31
Sarvan AL11-Jan-06 2:31 
AnswerRe: ON_NOTIFY_RANGE and Textbox's KillFocus Pin
Cedric Moonen11-Jan-06 2:33
Cedric Moonen11-Jan-06 2:33 
AnswerRe: ON_NOTIFY_RANGE and Textbox's KillFocus Pin
FarPointer11-Jan-06 3:15
FarPointer11-Jan-06 3:15 
GeneralThanks: ON_NOTIFY_RANGE and Textbox's KillFocus Pin
Sarvan AL11-Jan-06 21:43
Sarvan AL11-Jan-06 21:43 
QuestionHow to set the End of File to a file opened by "fopen" with "r+" Pin
Sarvan AL11-Jan-06 2:23
Sarvan AL11-Jan-06 2:23 
AnswerRe: How to set the End of File to a file opened by "fopen" with "r+" Pin
Prakash Nadar11-Jan-06 2:54
Prakash Nadar11-Jan-06 2:54 
AnswerRe: How to set the End of File to a file opened by "fopen" with "r+" Pin
kakan11-Jan-06 4:04
professionalkakan11-Jan-06 4: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.