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

Why is everyone..

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

But we don't even agree on the color scheme for C/C++ at the moment, and so changing the rest of the languages wouldn't really make sense.

Naa..its not changing, it fixing the broken highlighting. Mr. Rashakil previously complained about the broken highlighting of Scheme. So its not actually changing the rest of languages but actually fixing them.

I think C/C++ is the most important at the moment, as that is the most popular language on these forums, so if that could be tweaked a little bit it would be great.

Psst...dont let the people of other language forums hear this .....:mrgreen:

Btw, nice avatar.

Hehe thanks -- suits my personality. Evil, calculating, serious, dark....:twisted:

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

Maybe I'm being thick, but I can't see any way of passing by reference except by passing a pointer.

If you have gone this far, wont it be more generic to say that inorder to pass by reference in the end you need the address of the data segment.

Be it language semantics or mechanics, be it pointers in C or references in C++, it all boils down to the simple concept of manipulating the contents placed at a given address( if you have the privileges ).

It should be well kept in thought that "Pass by reference" and "Passing reference variables" are two different things, well actually the latter is one techinique by which the former can be implemented.

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

Congratulations, sit back, relax and enjoy your weekend. ;)

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

Sheesh you got confused between the two pointers girly...:D

Here is the modified version, I just swapped p and str and made a change to the condition being checked..

void removeSfromString(char *str)
{
    char *p;
    p = str;

    while (*p != '\0') // '\0' is the string-terminator character
    {
        *str = *p;
        p++;

        if (*str != 's' && *str != 'S')
        {
            str++;
        }
   }
    *str = *p;
}

Hope it helped, bye.

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

Copy the current character from source to the current character of ptr.

This doesnt mean to use strcpy( )..you are not dealing with strings here, jsut normal characters. Assign the character at the position source to the character pointed by ptr. *ptr = *src ;

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

You have used two variables in your function and that too not of pointer type which goes against your program requirement.

As far as this program is concerned go with Mr. WaltP's algorithm and it should work out to be fine.

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

Your PC is infected with tracking cookies and viruses. Try to scan with AVG trial version( lastest ) and see what it comes up with.

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

Since the poster asked for a more "specific answer" (she since edited that out of her post), I clarified.

That explains it all ;)

I wasn't arguing with you, but object instantiation, and object initialization, are separate (but related) things. The "constructor" is called during initialization.

Neither was I but your stmts got me confused so I just wanted to get things clarified.

Peace all.

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

All the normal compilers will work with the SQL commands if you set up the path for header and library files and include the required header file in your prorgram. So you can continue using the compiler which you are using right now (cant say the same if you are using Turbo C).

You can search on google for [search]mysql and c++[/search].

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

IMAO,...... *a good beating*

Yeah yeah yeah....I really get to see a lot of IMAO nowadays....;)

Anyway, if you notice the times, I was responding while she was posting. It takes me more than 60 seconds to type up a response.

Her post was at 1.30 AM and your answer was at 1.22 PM :twisted:( at my place but still 12 hr difference no matter where you stay)
Maybe Miss Dani should start using a 24 hour clock....:P

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

First thing, your function definition should be void deleteS (char* ptr) -- this passes in a pointer, you are passing in an array of pointers.

That was a typo I think, she has already taken care of this in her last post.

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

Simple..pass by value was present way before references were introduced in C++, so to go out to say that you consider pass by reference only when a actual "reference variable" is passed is wrong.

Pass by reference is done in two ways:
1. Pass by reference using pointers
2. Pass by reference using reference variables

And array actually are passed by reference since the name of the array holds its address. And the reason why arrays are by default passed by reference is to avoid the creation of a temporary array inside the function since arrays normally pack a lot of data. Creating temporary may be a waste of processor time and the precious memory.

So reference passing at the very core implies passsing the address so that the object can be manipulated using its address rather than using its name which is used for normal variables.

But as you have created this thread I know many people would be jump on the discussion bandwagon readign the thread title :D

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

Both counter and ptr point to the same memory space.. so when you modify ptr in the loop you end up modifying what counter points to.

And btw have you read the description of strcat( ) since it is not doing things in your case whch you are expecting it to do.

You can look into memmove to solve your problem.

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

Why not break it down a little bit?

For example, Dani could simply work at C/C++ syntax coloring, test different versions, perhaps get us to vote on which one we like the best, and set it in place. Once Dani's confident that the color scheme works, she can possibly apply it to other languages.

But I think you miss the point here. This thing has actually started(methinks) so that the other langauges which dont have a proper syntax highlighter( like scheme ? ) get a highlighter.

Starting work on C++ again and then testing those samples out might again delay the very reason why we need a common highlighter.

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

Objects are created when you declare them (when they are on the stack frame) or when they are dynamically allocated.

Nope.

The above sentence is in conformance with the "Professional C++" by Wrox Press, you dont agree with this ?

If a class has a constructor, the compiler automatically calls that constructor at the point an object is created

class X {
int i;
public:
X(); // Constructor
};
Now, when an object is defined,
void f() {
X a;     // here a is *defined*, X obj created and constructor is called
}

Thats what I said in my previous post, what is wrong about it ?

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

Yes Miss Dani has made some changes regarding the rules for keeping signatures.

A 5 line limit has been placed along with not allowing the use of colors (methinks).

So better not change your signature otherwise you would lose it forever..:D

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

How can you say this? You've never used it so what is your opinion worth?

I thought you would understand seeing the name of the topic :D
"New Firefox v/s New IE"

I have never used, wait, not even seen the new IE7. Used IE6 a long time back (when it was introduced) but then after Firefox started to catch up have been using Firefox, Opera etc.

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

The sizes you are talking about are the size of data types.

int data type holds integer values, in laymans terms numbers which dont have decimals in them and they take up consist of 4 bytes.

char data types hold ASCII values which are 8 bits ( 1 bytes ) hence size of character is one byte and so on..

But the point here is that pointers are "addressing mechanisms" and pointer variables "store addresses". If you keep these two highlihghed points in mind you should never have confusion regarding size of pointers.

And the size of pointers is 4 bytes ( 32 bits ) since you are working on a 32 bit platform / OS . It has alot to do with processor architecture, internal registers, memory addressing...

Some basic pointer tutorials here.

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

Just to strengthen your basics a bit, write a small code which declares pointers of char, int and double data type and print out their sizes.

The results would be interesting to note...

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

I have told you in my previous to previous post to print out the result after each operation so that we can easily spot the problem..you still havent done it.

Paste the result after each execution here and you will your self be able to find the flaw.

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

Yes, the first swap function only switches addresses. If you have got that figured then the confusion should end and you should be getting the correct answer.

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

Objects are created when you declare them (when they are on the stack frame) or when they are dynamically allocated.

// object declared and created, mem allocated, default constructor called
Object obj ; 

// object created dynamically ,default constructor called 
Object o = new Object( ) ;

The way constructors fit in the picture is when you want to assign values the class members or variables at the time of creation which you cant do without a constructor.

Hope it helped, bye.

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

Keep tab or print out the array after each iteration to give yourself a better understanding of what exactly is going on.

BTW your first swap function doesnt do anything, I'll leave it to you to figure it out.

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

Yes, it works fine.

PS: I was just wondering why you ask these questions in the forums, surely you can try compiling the program, runnign it and see whether it works or not or can't you ?

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

Assume you have been offered a high-salary job in a software company that develops games for children. You have been assigned to work on developing a game that is uneducational (e.g. about fighting enemies or chasing thieves) and you believe that such a game is waste of time for children and corrupts the public manners. What would you do in such a case?

The company makes or develops games for "children" as you say. So is this your assumption or it is what the company says. If this is what they say then how come they have started developing action games....

BTW the answer is simple, you accept the offer. Also a plain and hard fact, you cant change the world you know, if you dont accept the offer, someone else will, if he doesnt then somone else and so on.

If you leaving the offer thinking that the game wont reach completion or your rejection of offer will make them reconsider their idea, then you are wrong I fear.

Of course if your conscience doenst allow you to do such things, you just leave it and be happy that you are not involved in such a thing.

Good luck

Why am I feeling that this is a fictious situation / senario ? ;)

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

Go with the cheaper one if you dont play games that require high amount of graphics.

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

Welcome to Daniweb, hope you enjoy your stay here. :D

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

Creating a uniform color for all langauges is a *Herculian* task not to be bothered with for the time being.

Then again it depends on Miss Dani -- is she comfortable writing php scripts for highlighting constructs for each and every language seperately or she thinks that keeping a uniform color scheme would be more like it.

Also it should be kept in mind that you can never get everybody to agree to a single thing..

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

I just couldn't imagine why someone should spend money only to buy a title - doesn't it foil the concept of e a r n i n g a title, since that's what titles and ranks are all about? Are there any questions left now?

Ok looks like you dont know the real concept behind sponsorships or what earning is.

The more the donations come to Daniweb, the more easier would it be for Miss Dani to remove ads so that the browsing the site yields only content and not ads. Though its a long shot, its worth a try.

So in a way the sponsor would be contributing to the community with his hard earned money. There are different ways a person can contribute to a community, depending on the resources he possesses. Going out to say that the sponsor has *not earned* the title is I think like insulting them. Money doesnt come for free you know...

Professionals contribute by helping other people out with their knowledge, do good work and are made moderators. Sponsors help the community out by givign out their hard earned money to this forum. Atleast they expect something in return for their kindness.

A real life example -- game developers go out to make real good games but they wouldnt succeed in their efforts if there was no money involved. Money is always in the background. Saying that Game producers or sponsors dont play a role in the success …

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

You writing the game in VB :-o

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

True, I agree that it's a good reason to celebrate when you remember someone for his good deeds. But in whole I find the idea a little hypocritical.

Hehe I am not celebrating..there is no such thing like "Thanksgiving Day" in our country. I was just being funny saying that the day they are enjoying so much is due to the guidance and help provided by an India....

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

Its kind of annoying because I was 16 later than most people in my year at school and I finished my exams later than most of them so I missed out a bit on the job market. Now were in college and all of them are taken (Ive applied for 9 in the past 3 months) :( Its prety depressing when McDonalds say they dont require your services.....

Some story this is...hehe.
BTW what happened to your plans of becoming a game developer.;)

So maybe il have some luck today

OK guys, I'll try to write more neatly in future. It's just that most of my posts are done from my PDA and its a bit hard to type on it.

:D

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

Thanks for explaining that.

Well I have an interview at Waitrose today so maybe theyll hire me and i can start earning some money

BOL (Best of Luck)

Hope you get the job, the sponsor badge, the custom title, the access to Area 51, .....:cheesy:

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

Aaahhww...

But wait! So to thank the indians for this act of goodwill, the Americans killed thousands of them a few 100 years later (19th century) and put the rest in resorts like wild animals... But hey! At least 1 day each year there's still a day to celebrate that an indian in 1621 helped his future oppressors.

Personally I like this explenation better:

Depends on one's view point...you like one explanation, I like another.

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

I think what he means is that, if you help people, they will somehow get into a lot of money because of your help and then maybe would be able to sponsor Daniweb.

But the thing it that....it will leave you as a normal member :D

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

he Pilgrims were particularly thankful to Squanto, the Indian who taught them how to catch eel, grow corn and serve as interpreter for them (Squanto had learned English on a previous trip to Europe). Without Squanto's help the Pilgrims might not have survived in the new world.

Ahhhhh....
So here it goes, Happy Thanksgiving to all of you people.

PS: Its good to have you back Mr. Dave, long time no see.

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

You must attempt something before we help you out.

Paste the code which you have written till now.

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

I have no idea . It's "turkey day" and you eat a lot with family. That's all I know.

I expected something more *enlightening* :lol:

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

What happens on Thanksgiving day ?

In memory of which event is this day celebrated ?

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

Never used IE, always use FF.

Personally what I feel is that IE sucks...(atleast IE6).

Hell, even Avant Browser is better than IE.

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

wouldn't the "fish" array be a good place to use "enum"?, Then just use an integer array?

No.

The exercise given to the OP was to strengthen the concepts regarding pointers and the likes. There is as such no real program here. And as far as the fish types are concerned -- you are better off using normal char strings. And I dont understand what you mean by using enumns and then integer arrays ? Care to elaborate ?

@aznballerlee

You can find out more about [search]enums in c c++[/search] on google. For the time being just concentrate on your excecises -- you are doing really fine.

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

According to me the purpose of the post shouldn't be defeated.

I can easily find out whether a person doesn't know English or is just lazy.
Eg. of not knowing English:

I write the code in C++ language and now it is in Visual Studio. I have pressed button but many errors below the screen. My program right but it shows wrong and not works. Thanks to you.

And for the lazy ones:

Ya wadaya knw guys, I right a prg and lol it dn't compiel. Can you sort it out for me ? Chers .

And for those who dont English and not even spellings

Me write a prograam and rite it shold be bt dont do like i write. Hlp plss. My poor eng so pls sry me.

The above sentences are not fictious, I have myself seen them at many places. For people who dont know English, I dont at all mind, we can't blame them for coming from different parts of the globe, but for those people who are English and when they write using shortcuts argh...

For a person like me whose first language is not English, I try very hard to write to the best of my knowledge and capabilites and learn from other people's post. This is the least a human can do -- "learn from others".

"If i hrt ane1, give me pardon, i not english" :D

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

Personal messages and emails will not be ignored.

And I like this (hehe)

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

:D

Ah come on man, whats so funny about it, its just an unique way of saying it ya know :mrgreen:

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

So why arent there any other groups other than Staff writers ?

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

Thanks -- have got the idea loud and clear. Thanks for your time and effort I appreciate it.

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

So it means that since you have a silver badge of "Staff Writer" you are member of the staff writer group which is a elite group dealing with Blogs.

In the same way suppose we can have a group "Game Developers" which will be featuring all those interested or have some experience in game development, is it ?

Thanks for responses.

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

Thanks a lot Mr. Tgreer for the information. Just wanted to ask what is the actual purpose behind groups ? Can users or other people request the admins to create non technical groups?

Thanks again.

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

What exactly is Group membership which appears in the control panel? Can custom Public Groups be created?