Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

Come on guys... is anyone going to be on my side? If not, I'm just gonna stop debating because everyone obviously has their minds made up and I've spoke what I've had to say.

Yes I agee that this thread has probably gone as far as it can. We all have our own thinking on the topic because no one, not even supposedly knowledgable scientests, know why homosexuality happens. And it isn't unique in mankind -- other animals also behave that way. Its none of my business what people do in private as long as its otherwise legal and not physically harmful to someone else. The idea I personally wanted to get across is one of tolerance -- we should not hate someone just because they a different religion, a different color or a different sexual orientation. We are all people and should respect one another for that.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

just looking over that tutorial it looks way to complicated and difficult and complex means it looks hard. Is there any easier tutorials?

No there isn't. If you want to learn C then take the time to study and understand it. I thought it was hard at first too -- had problems with a simple "Hello World" program. People spend hundreds of hours mastering programming languages. If you don't have the time, patients, or inclination then you probably should take up playing the piano instead of computer programming. But that too is difficult for many people.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

>>if suppose an device
Its "a device" -- see these grammer rules

>>is this possible in c?
Yes. I think you will have to write a device driver. But you first have to decide what operating system you want to use. MS-Windows you get the Windows DDK (Device Driver Kit).

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

Okay, here is where I can prove that homosexuality is a decision... first of all - when my gay friend tells me that he chose to be gay.

That proves nothing. One person's voice doesn't speak for everyone.

And second - when homosexuality is considered "abnormal" and "unnatural" because it causes the inability to reproduce in the human race.

not relevent to the decision to be gay ot straight. And even straight people do not have sex just to have babies. In fact most of the time a baby is just an afterthought or no thought at all. People have sex because its fun, not for other reasons.

Homosexuality is a lifestyle, not based on genetics.

Hetrosexuality is also a lifestyle -- if you want to use that word.

Even science does not support the claim that homosexuality is genetic... and you can find evidence everywhere. Scientists have actually discovered that most of the reason why people are homosexual is due to environmental factors that can elicit some behavior.

That's at least partly correct -- but doesn't explain it all. Recall that ALL gay people had straight parents, you said it yourself. I could understand the environmental argument for kids raised in brothels where they are exposed to every conceivable sexual behavior. But most gays are raised in every-day homes with every-day mothers and fathers.

And if anyone has noticed, homosexuality/bisexuality has become more and more prominent... why? Because society has let it become an "okay" lifestyle.

iamthwee commented: To dress up in his big sister's "cloths" first he must sew the cloth together to make a garment. The very act of sewing would also be a strong hint that the kid was gay, me thinks. +11
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

The posted code is not really much of a benchmark program and will not adequately make the test you want with it because the programs are just too trivial.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

http://www.youtube.com/watch?v=rG812QpZsuQ

Too bad we couldn't hear the rest of that.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

See this MSDN article -- scroll down the page to the section Communications Resources


>>Also please let me know how to test on the second PC after transferring data from the first PC.
You need to write the software yourself that will run on each PC. On PC #1 write a program that will xmit the information and on PC #2 write a program to receive the data and verify that the data sent is the same as the data received.

You can get ready-made free libraries that do both RS232 serial communication and socket stuff from here. It contains several example programs to illustrate how to use the libraries. Yes, you have to compile the libraries or DLLs with your own compiler. make files have already been generated for the most popular *nix and MS-Windows compilers.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

Well I've made up my decision that I'm not going to believe gays are 'born that way' until it is proven. So till then, we just have different "assumptions."

Can you prove you were not born hetrosexual ? No, you can't prove that either. Think of it this way then: how difficult would it be for YOU to "choose" to become a lesbian ? My guess -- practically impossible even if we ignored the Bible. So then, did you "choose" to become a hextrosexual or were you born that way? At what point in your life did you conscientiously decide that you like men rather than women. Again, you probably didn't -- you made that decision without even thinking about it.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

Murderers choose to kill, liars choose to lie, cheaters choose to cheat, adulterers choose to commit adultery... gays choose to be homosexual. God created these individuals, but they chose their lifestyle.

You are assuming that gays choose to be gay. That is in reverse also that hets choose to be hets and therefore could just as easily choose to be gay. I don't think it is that easy or even works that way. Just as people are born with skin color people are also born with sexual orientation (which is also an assumption on my part).

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

Wrong. They changed things to allow multitasking.

Who do you mean by they? One reason operating systems support multitasking is because the CPU chips allow it, and as you know the CPU chip is not the operating system. Another reason is to allow programs to access lots more memory. Under MS-DOS the maximum memory possible was 640K, and the operating system and all device drivers consumed part of that. Programmers all over the world were screming for help getting more memory. Well Intell and Microsoft gave them their wish. If you don't like that then you are always free to remove the MS-Windows and *nix from your computer and replace it the MS-DOS version 6.X, then you will be back to where we all were 15 years or so ago. Of course you will not be able to play any of the current games or access the internet.

I used to be able to rename a group of files using a template. This is no longer possible.

Oh yes it is -- using Windows Explorer highlight a group of files then change the file extension of one of them -- they will all be changed to the same file extension.

And they took away the ability to pause execution for a given time interval and to generate sounds or waveforms in the program

What! Those are still available in win32 api functions and *nix functions. C and C++ languages never ever supported them as part of the language.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

There are millions of examples because they are frequently used in every-day applications. But a simple introduction might be to write a function that sets all the bytes of a character array to 0. Function prototype might be

void clear_array(char* array, int size);
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

Ok you have the function prototype, now create a structure with the required data members and a pointer to the head of the linked list. After that fill in the function you posted with the code. Read some of the other threads here and you will find several similar examples.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

see the link near the bottom of this page. But I don't know if it is free or not.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

that's because the loop is wrong. You don't need to use eof() at all

while( getline(inData, line) )
{
    size++;
    // do other stuff here
}
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

>>I already started some but it wont work.
Can't help you if you don't show us your code.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

when using 32-bit programs you have to forget about what you learned with old 16-bit compilers. It ain't gona work. They don't support anything in graphics.h or dos.h. You will probably have to do a 90% rewrite of that program you want to compile.

If you want to do ms-windows programming then use win32 api functions. Here is a short into tutorial, but it does not touch on drawing.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

next you need to put all that code inside an infinite loop so that it will get repeated until someone selects the 5th menu item. Then after printing the menu you need to get user input by calling cin.get(). You also need to write four functions, one function for each of the menu items and call the appropriate function after getting user input.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

- Why do most spreadsheets and programming languages do trigonometric functions in radians, when most people use degrees?

For the same reason Americans use Imperial system of measurememt while most europeans use the metric system. Just because.

- - Why do most of the C-based languages (including Java, JavaScript, and Perl) have two different syntax forms to call functions with, depending on which function you want?

Don't know what you mean. C does not permit overloaded functions.

- - Why does Microsoft change the name of everything from what others called it before (a "directory" suddenly became a "folder", and a "procedure" became a "method").

Microsoft had little, or nothing, to do with the naming of "procedure" and "method". C and C++ languages do not have such a thing as a "procedure". Instead, they have functions and methods and those two terms are often used interchangably.

- - In the 1980s, kids all over were programming computers. With the change to Windows, this suddenly stopped, as Microsoft made programming a lot harder to do. Why?

If you want to stick with MS-DOS operating systems then go right ahead. You can still run 16-bit applications in the newest version of MS-Windows and compile with with 16-bit compilers such as Turbo C.

-- Why have all of the easy-to-use programming languages been replaced with the hard-to-use C derivatives?

They haven't been replaced by C. You can still use QBASIC if you want to. But you will probably not be …

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

win32 api has two functions depending on your needs. SendMessage() will send a message and not wait for a response, however the called function will not run concurrently with the caller. If you want the two functions to run concurrently then you have to create another thread and run the second function in that thread.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

you will need to create a thread that just listens for and receives data from the socket then, when ready, sends a message to the main form thread that the data is ready. I assume QT has mechanism to send and receive messages among threads.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

I've heard about it but have never seen it played. It appears to be a simple form of American Football, minus all the body protection. Ouch!

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

I also see this statement as being rather selfish. You would never dare to ever be friends with someone who is gay, but if they've invented or discovered something (in other words, have something you need or want) .

The movie industry is a great example of that -- we all like good movies and good actors in them because we want to be entertained. But how many people outside the movie industry realize that most (or more accurately many actors are gay ? Yet we the audience flock to the threaters to watch them for entertainment value.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

see the instructions for int86() function. Google and you will see examples.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

Another problem I see in the original code is line 11 -- you have to make sure that the buffer size is big enough to hold all the digits that sprintf() will want to put into it. In your code buffer can only hold 9 characters plus the null terminator but sprintf() will attempt to fill it with 10 characters plus null terminator (310.589???) because the default is to display 6 decimals. So sprintf() at line 11 will cause buffer overflow and that function will scribble the remaining characters all over other memory.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

lines 13 and 14 are incorrect. Should be this:

printf("using &num= %p\n", &num);

Your line 14 will probably cause access violation because printf() assums the first parameter is an ascii null-terminated string, and passing a pointer to a variable is not that kind of thingy.

[edit] ^^^ what vijayan121 said too. [/edit]

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

First, when you allocate a new node make sure you set the next pointer to NULL (or 0). Then its just a simple loop to look for the last node (tail) in the list

Node* tail = head;
while( tail->next != NULL)
     tail = tail->next;
// now pointer tail points to the last node in the list
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

please re-read my answer to your previous thead here. I already answered this question.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

what operating system and what compiler ?

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

Oh you mean print a label on the CD -- not put stuff on the CD like a writer would. You don't have to use HPs software -- I've seen similar programs on the net and at Best Buy. I don't know how its done but its probably a graphics program that sends the bitmaps to the printer.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

I'm right handed, but my son is left handed.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

>>thanx for ur reply..but i am not familiar with fgets function.please help.

Look it up in your text book or online. You can't learn to program if you have to ask us for every keyword and function you want to use. You can use google to find all standard C functions, like this

google:  man fgets <Enter key>

You can also read some of the other threads here -- there are lots of examples using fgets().

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

ok... let me correct myself... i don't hate gays... i dislike them... happy?

Yes, much better.:)

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

Never heard of such a thing -- a printer that prints onto CD's ?? I can only assume you are not referring to a normal paper printer. If not, then you will probably have to contact the manufacturer for a programmers manual and device driver.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

I am going to show you how you can stop using scanf() to read text

I think a better way is to use fgets() and avoid writing that reads() function.

fgets(name, sizeof(name), stdin);
// remove the trailing '\n' that fgets() might put in the buffer
if( name[strlen(name)-1] == '\n')
    name[strlen(name)-1] = 0;
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

When you add the node to the list in get_input() add it to the tail, not the head. There are at least a couple ways to do that. 1) search for the tail of the list each time you want to add a new node to the tail, or 2) keep another tail pointer, similar to how you do the head pointer.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

Technically, a case could be made for choice. There is a difference between having homosexual inclinations and being homosexual; the latter requires specific action to be taken along the lines of the former. Even if someone is, for some reason, inclined toward such behavior, they still have the ability to choose otherwise. I acknowledge that in today's culture (in the US at least) the word abstinence is unpopular, but it's still an option.

You are confusing having sex and being gay. One can practice absistance and still be gay or not gay. One doesn't have anything to do with the other. [edit]well, except that gays have same sex and hets don't.[/edit]

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

oh... come on... will you tell me you never use the word hate to refer something you dislike?

Yes. Hate begets abuse, such as spousal and child abuse, burning crosses on laws, burning churches, dragging people behind cars, etc. Hate has no place in our society and under some circumstance there are laws against it.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

>>experimentation just to see what it feels like to do things different, and end liking it
I would suggest that a truely straight person would not even imagine doing that. Having sex with same gender is just as revolting to straights as having sex with opposite gener is to gays. A third group consists of people who go either way.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

There is a huge difference between dislike and hate. There are some things I dislike about my wife but I certainly don't hate her.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

>>as i stated it in the other thread, gayness has nothing to do with natural processes
And your proof? Where is your Ph.D. in something? There has been a lot of discussion on that topic and even the experts don't know the answer. Is it genetics? I agree its probably not. Environment influence ? No, not that either because gay people are raised in hetrosexual families. Choice ? No, very few if any gays choose to be gay, just like straight people choose to be straight. So what is it -- I don't think anyone knows.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

line 7: your_name is a single character and you are attempting to use it as if it were a character array in line 41. Change the declaration in line 7 to be a character array.

Or, better yet, since this is a C++ program change it to be std::string class object, assuming your instructor will let you do that.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

>>first of all... let me make myself clear... i hate gays... i hate everything that has to do with gays...

I certainly hope this thread does not turn into hate speech. If it does then we might have to give someone an infraction, delete their post and close this thread.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

However, the majority of the world's population is Catholic.. so therefore christianity is the top dog amongst religions...

wrong -- only about a third are Christian

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

whether its working or not -- DO NOT DOWNLOAD THAT FILE. Never ever download a file with *.doc extension because it could contain nasty viruses, worms, etc.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

>>when i was talking about hating everything gay, i wasn't talking about what they've invented, because the fact that they're gay doesn't mean they're intelligent...
Ok, then what did you mean?

>>is a decision from a human being about going the wrong way...
many people do not believe gayness is a personal decision but rather something they are born with, similar to skin color. A gay person could no more change his behavior than a straight person could (or would want to) become gay.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

Ohh, mistake in the title, can someone repair it?

Fixed -- but next time you should use the Flag Bad Post button to make such a request easy for one of the mods to see.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

>> temp->name=new_person[];
Is that line 130? You can not assign char arrays like that. You have to use strcpy() instead, like this:

#include <cstring>
<snip>
strcpy(temp->name,new_person);

>> temp->next=Front;
>> Front=temp;

Circular reference -- is that what you really want ? It results in Front->next == Front, and you have lost all other nodes that may have been in that linked list.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

Additional question. Does ifstream reads a space as a beginning of a new line?

No -- when you use the extraction operator >> the stream only reads up to the first space. That is why I suggest getline() in my previous post.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

If you use getline() on line 64 you will avoid the space problem. getline() will read the entire line, then you can separate it into comma-separated tokens.

Line 61 is incorrect -- you should avoid using eof() like that because it will cause problems. Use getline() instead, something like this

while( getline(str,inFile) )
{
    // blabla
}
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

>>how do i initialize it if i don't know how many names there will be?
If you use c++ vector class you don't need to know how many names because that class will expand and contract as needed.

>>if i want to write a sort function, how to i call a multi-dimensional array and return a new array from it?

You don't have to write a sort function because c++ already has a ready-made sort for you.

#include <vector>
#inlcude <string>
#include <algorithm>
...
<snip>
std::vector<std::string> array;

// now sort it
std::sort(array.begin(),array.end());

I hope that's correct.