Click here to Skip to main content
15,917,320 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Share files across Projects in the same solution Pin
Cedric Moonen12-Nov-07 22:48
Cedric Moonen12-Nov-07 22:48 
GeneralRe: Share files across Projects in the same solution Pin
uusheikh12-Nov-07 22:57
uusheikh12-Nov-07 22:57 
Questionhelp Pin
youbo12-Nov-07 20:22
youbo12-Nov-07 20:22 
JokeRe: help Pin
Jhony george12-Nov-07 20:35
Jhony george12-Nov-07 20:35 
AnswerRe: help [modified] Pin
Llasus12-Nov-07 20:55
Llasus12-Nov-07 20:55 
AnswerRe: help Pin
ThatsAlok13-Nov-07 4:56
ThatsAlok13-Nov-07 4:56 
Questionwhich edition of VC is the best ? Pin
youbo12-Nov-07 19:51
youbo12-Nov-07 19:51 
AnswerRe: which edition of VC is the best ? Pin
David Crow13-Nov-07 3:36
David Crow13-Nov-07 3:36 
QuestionMute button Pin
Anu_Bala12-Nov-07 19:34
Anu_Bala12-Nov-07 19:34 
AnswerRe: Mute button Pin
Rajesh R Subramanian12-Nov-07 20:51
professionalRajesh R Subramanian12-Nov-07 20:51 
AnswerRe: Mute button Pin
_AnsHUMAN_ 12-Nov-07 20:52
_AnsHUMAN_ 12-Nov-07 20:52 
AnswerRe: Mute button Pin
Johpoke12-Nov-07 21:14
Johpoke12-Nov-07 21:14 
GeneralRe: Mute button Pin
jhwurmbach13-Nov-07 2:02
jhwurmbach13-Nov-07 2:02 
QuestionHow to find that I've select the correct file. Pin
CodingLover12-Nov-07 19:26
CodingLover12-Nov-07 19:26 
AnswerRe: How to find that I've select the correct file. Pin
Malli_S12-Nov-07 21:15
Malli_S12-Nov-07 21:15 
AnswerRe: How to find that I've select the correct file. Pin
chandu00412-Nov-07 21:53
chandu00412-Nov-07 21:53 
NewsRe: How to find that I've select the correct file. Pin
CodingLover13-Nov-07 16:55
CodingLover13-Nov-07 16:55 
AnswerRe: How to find that I've select the correct file. Pin
Nelek13-Nov-07 21:53
protectorNelek13-Nov-07 21:53 
GeneralRe: How to find that I've select the correct file. Pin
CodingLover14-Nov-07 16:27
CodingLover14-Nov-07 16:27 
Questionhi i have problem with displaying controls Pin
chethu66512-Nov-07 19:15
chethu66512-Nov-07 19:15 
QuestionProblem printing c-string Pin
SamRauch0112-Nov-07 18:57
SamRauch0112-Nov-07 18:57 
This is a simple assignment for my c++ class requiring us to convert some text in a char array inline, not using another array. My code compiles with no errors, but when I run the program nothing comes out. I guess somewhere I'm accidently overwriting the entire string to nothing but... yeah. Anyhow, in the array, the following changes are supposed to occur: th -> z, s -> z, and r -> rr. This, of course, requires the entire string to be shifted if in the cases of th -> z and r -> rr. Here is my code:
<br />
#include "stdafx.h"<br />
#include <br />
#include <br />
#include <br />
<br />
using namespace std;<br />
<br />
#define MAX_SIZE 100<br />
<br />
int getLength(char inputText[]);<br />
void moveLeft(char* inputText, int index);<br />
void moveRight(char* inputText, int index);<br />
<br />
<br />
void main()<br />
{<br />
<br />
char text[MAX_SIZE];<br />
<br />
cout << "Enter your words here: ";<br />
cin.getline(text, MAX_SIZE);<br />
<br />
int sizeText = getLength(text);<br />
<br />
int j;<br />
int k;<br />
<br />
for( j = 0, k = 0; j < sizeText; j++, k++)<br />
{<br />
if ( (text[j] == 't' || text[j] == 'T') && (text[j + 1] == 'h' || text[j + 1] == 'H'))<br />
{<br />
text[k]= 'z';<br />
moveLeft(text, k);<br />
j++;<br />
}<br />
else if (text[j] == 'r' || text[j] == 'R')<br />
{<br />
moveRight(text, k);<br />
text[k] = 'r';<br />
text[k+1]= 'r';<br />
k++;<br />
}<br />
else if (text[j] == 's' || text[j] == 'S')<br />
{<br />
text[k] = 'z';<br />
}<br />
<br />
}<br />
<br />
cout << "The new line is: " << text << endl;<br />
<br />
}<br />
<br />
int getLength(char inputText[])<br />
{<br />
int length = 0;<br />
while (inputText[length]!= '\0')<br />
{<br />
length++;<br />
}<br />
<br />
return length+1;<br />
}<br />
<br />
void moveLeft(char* inputText, int index)<br />
{<br />
for (int i = index; inputText[i] = '\0'; i++)<br />
{<br />
inputText[i] = inputText[i+1];<br />
}<br />
}<br />
<br />
void moveRight(char* inputText, int index)<br />
{<br />
for (int i = 100; i > index; i--)<br />
{<br />
inputText[i] = inputText[i-1];<br />
}<br />
}<br />


Any help that you could provide would be greatly appreciated! Thank you!

-Sam
AnswerRe: Problem printing c-string Pin
Malli_S12-Nov-07 21:23
Malli_S12-Nov-07 21:23 
AnswerRe: Problem printing c-string Pin
David Crow13-Nov-07 3:40
David Crow13-Nov-07 3:40 
Questionthread pool Pin
Jhony george12-Nov-07 18:45
Jhony george12-Nov-07 18:45 
AnswerRe: thread pool Pin
Stephen Hewitt12-Nov-07 18:59
Stephen Hewitt12-Nov-07 18:59 

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.