~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

Now is the time, run for cover.

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

Heh really an interesting thread...From a "beginner asking for advice" to "I will definately take revenge"...Oh, what has this world come to... :D

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

People will do what they have always wanted to do, whats in their nature. We can only fool ourselves into believing we can understand someone else's pain. We give him advice, we forget about it. In the end, he will do what he feels he should do. Thats the bitter truth."Only he who has died, knows how it feels to be six feet under..."Thank you.

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

Dani, as far as being a global community is concerned, one can always set the time zone in the CP (mine is GMT + 5.30) so that all the posts time are displayed wrt my time zone. The point being, if not many members are liking it, it would be best to remove the feature altogether. After all the ones who visit Daniweb regularly are entitled to fair browsing.

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

Oh, Salem, you're so funny

Maybe he wasn't being funny....:twisted:

Satish, read this for a detailed explanation.

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

You have just gone out to show one of the horrors of using the GOTO statement in C/C++... :D

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

Hello my friend, welcome to Daniweb. Hope you get a load of PM's... ;)

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

'Them bones' was a good song by Alice in Chains.

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

JAG - jaggery

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

around. Don't bother

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

demoralize you till

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

Bring Me to life - Evanescence

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

scrape

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

Like I said before, you need to read in the entire line in a string and start parsing it yourself, treating the string as an array of characters. For this, you will need functions which help you in determining whether a character is a space character or not. The function I am talking about is isspace().

for(int i = 0; i < myString.size(); ++i)
{
    //means that the character is nonwhitespace, so the string must contain other characters
    if(isspace(myString[i]) == 0)
    {
         stringHasCharacters = true;
         break;
    }
}
~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

You WISH! (why oh why did I ever post in that thread...)

Oh come on cheer up, you got yourself a really good nickname...:mrgreen:

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

Yeah, I guess you are missing on your basics pretty badly. I would really recommend you to start googling for terms like C++ structs, loops, conditions, functions, file operations etc...Try coming up with a code which is somewhere near the actual problem requirements and we would definately help you out.

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

Have you tried googling it ?

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

Oh and btw, just call him Joey, he really likes it. :D

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

the world's biggest

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

humble - bumble bee

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

spend life with.

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

Bad weather is one of the things which mars a good game of cricket.

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

chump

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

Cold day in the sun - Foo Fighters

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

Hello there David, welcome to Daniweb. :D

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

Hello my friend, welcome to Daniweb. :D Oh yeah, and keep xlr8ting... ;)

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

So I guess you need to focus more on drawing bloggers...since as I see, blogging is the only activity which as you say generates increased search engine rankings.

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

So I guess the only option left is to manually parse the string character by character and draw your own results. Best of luck.

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

all the evil

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

spam

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

Me and I are different words used for denoting the same thing.

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

has a sword

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

inferior - lowly

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

which girlfriend you

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

Have you been taught the find function in C++? If so then you can search the string for the character which doesn't belong to the family of whitespace characters. If you find one, write the line as it is, and if no character other than whitespace character is found (indicates blank line) just indent and move on to the next line.

//check for a blank line
if(find_first_not_of(" \t\r\f\n\v") == string::npos)
{
     //write a indent to the new file
}
else
{
    // write the line as it is
}
~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

A brand new day - Sting

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

Please take the cat out of the bag.

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

the god of

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

spanner

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

small act - sick rat

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

and surrender my

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

planted

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

planet

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

Think of it this way. A programming contest is announced. Big money is at stake.

Probably 1000's of people register and send in their codes. Who do you think would have the time to evaluate their correctness, not to mention there are probably infinte ways of solving the same thing. What would be the selection criteria ? More importantly who would evaluate all the enteries ?

Look before you leap.

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

I don't know what you are trying to achieve by doing if(!'\n'). This condition will never be true hence the whole file is given out as it is.

Also the trouble with this approach is that even lines which are not preceded by newlines but have indentations will always look indented. So you would have no way of knowing which lines were indented by the algorithm or which lines were indented from the start.

For proper formatting, trimming is a must.

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

Replace the round brackets with square ones [] and you are good to go...Oh and btw it would be a good idea to initialize your arrays.

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

I am mine - Pearl Jam

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

Choose what you want, the result will be the same.

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

the effort. Think

~s.o.s~ 2,560 Failure as a human Team Colleague Featured Poster

mature - think big