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

some compilers may support strupr() and strlwr() which convert the entire string, but its not standard. You can easily write such a function yourself.

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

Quite often working lots of hours is counter-productive. I recall a couple times I put in 72 hour days and the solution hit me after I finally went home. Working 80-hour weeks often is a bad bad idea because the mind needs a period of rest and relaxation. If your employer regularly requires you to work 80 hour weeks then quit and get another job. It ain't work it.

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

my favorite would have to be this one.

http://youtube.com/watch?v=NSzsfadjaQo

But this one would be a close second.

http://youtube.com/watch?v=STPFvrQEdXY

The first one was pretty funny -- the second pretty boring; didn't watch all of it.

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

That's all we need are more laws to do stuff that we already have sufficnent laws. Animal cruelty is already illegal and has done very little to stop it. So that makes you think more laws will help ??? Its not the job of our police to protect the animals -- its eveyone's job. And when animal cruelty is found the perputrators are jailed for awhile and the animals taken away from them. What more could anyone want of our government ? For these reasons I refuse to sign that petition.

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

you could also make it a structure that contains a union, something like the VARIANT structure that is used frequently by MS-Windows compilers such as VC++ and VB. It looks like this:

typedef enum
{
      UNKNOWN = 0,
      STRING,
      SHORT,
    <etc. etc. for each data type
} DATATYPE;
      
structure Variant
{
    DATA_TYPE variable_type; 
    union
    {
          unsigned char* strArray;
          unsigned short usVal;
          short  sVal;
          int iVal;
          unsigned int uiVal;
          long lVal;
          unsigned long ulVal;
          float fVal;
          double dVal;
    };
};
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

what about extending the edit time? how did you get to the conclusion that 30 mins was best?

Actually you should be able to edit your post a lot quicker than that! Does it take more than 30 minutes before you can read your post after pressing the Submit button ? Mine comes back within a few seconds and I edit it right away if it isn't correct. I don't wait for a half hour before looking at what I posted. My guess is that 5 minutes should be adequate.

>>The problem seems to be related to the change to the variable width font in the edit window, and then back to the constant-width font in the code tags

I don't understand how variable-width fonts in the edit box can affect the spacing of the code within code tags ? But maybe it does. :-O

Dani commented: My take on it, too +10
ndeniche commented: right... +2
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

That's nonsensical reasoning. If they weren't hired by the government, they'd be hired by a privately operated employer and paying the same amount in taxes.

You get a paycheck (assuming you are in the workforce) and you pay taxes. Those taxes go to the federal government, and the government uses those taxes to buy goods and services. The government does not manufacture those goods and services itself so it buys then from the private sector. Well, the private sector must hire someone to make the goods and services that the government wants to buy. Those people get a paycheck just like you do and pay taxes too. And this cycle continues all over again.

Nonsense you say?? Then take a course in Econ 101 and find out how it works. Its one of the most elementry theorems (if you want to call it that) of economics.

Or read this for a quick introduction.

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

Here is another popular tutorial

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

In order to understand the influence of government spending in our society you need to study Economics 101 and 102. This isn't the place for a year's college course in economics.

>>while the other is those jobs that compete with the jobs in the private market
No they don't. The government doesnot manufacture anything -- almost everything is purchased or farmed out to private sector. I live about seven miles from a major US military installation where they employ over 10,000 civilians as well as military and their families. The government spends a huge amount of money at that milirary installation as well as in all sourounding towns and cities. If the government stopped spending money here then all those jobs would vanish as well as thousands of jobs in local areas.

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

Wrong. For every 10 jobs the government "creates", 11 are lost to the higher taxes needed to create the 10 jobs.

Maybe true in some countries, but not here in usa. The jobs the government creates when it spends money gives people an income who in turn pay taxes which gives the government more money so that it can create more jobs. The federal government gives a state $100 million to build a new bridge and the state must hire 50 people to do that job. Those 50 people get paid a salary which is taxable, and at the end of the year (for most people) the send some of that money back to the federal government in the form of taxes. Where in that scenerao do you see the government increasing everyone's taxes? Our taxes are lower now than they were 8 years ago.

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

If that is the binary representation of the integer, then just typecast it or memcpy() it.

char array[some_number];

int n = *(int *)array;

or
memcpy(&n, array, sizeof(int));
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

The only problems I found were:
1. The structure next was incorrect

typedef struct _nodeList
{
   unsigned int pointCode; 
   struct _nodeList *next;
}NodeList;

2. right_configuration() must return a value.

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

line 10 will cause program crash because no memory has been allocated for name -- its only a pointer that points to some random memory location. Since this is a c++ program why don't you use std::string class instread?

include <fstream>
#include <iostream>
#include <string>

using namespace std;

int main(){
   fstream file("myfile.txt", ios::in | ios::out);
   string name;
   cout<<"Enter your name: ";
   getline(cin,name);
   file << name << endl;
   file.close();
}
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

I get spam in my email box several times a day. Don't recall seeing any about sex for quite some time now. Most of the ones I get now are like "How to make millions by doing nothing".

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

The way I do it is somewhat like Hamrick suggested -- create a project then change the source file(s) as needed. I test out many of the programs posted on the C and C++ boards that way.

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

did you read the Read Me thread at the beginning of this board? If not, then you should.

>> Is there any free tutorials in C that is very good
No. If you are serious about learning the language then buy any of the many books available at your local book store. Yes they are expensive, but worth every penny because they normally cover the language pretty thoroughly and provide lots of examples. Just don't bother with "blabla for Dummies" because they are not for newbes but only cover subjects very briefly.

If your goal is to just learn how to write simple games, then go for the online tutorials. But remember, many of those tutorials are old, obsolete and sometimes just plain wrong.

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

They finally admitted it :D

http://web20.telecomtv.com/pages/?newsid=41694&id=e9381817-0593-417a-8639-c4c53e2a2a10

I agree -- we in USA need not have our news media act like the newspapers of USSR which printed only what the communists wanted their people to hear. I don't think they have a right to cencorship as jwenting mentioned except to bleep out vulgar language and lewd pictures.

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

i get 3 build errors when i use the numbers

i dont know what the erreors were because .

did you try to compile your program or didn't you ??? If you did then what were the errors that your compiler produced ?

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

We already answered your vague question. Please see the links that were posted previously. Also read the Readme links at the beginning of this board because they give lots more help for newbes.

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

why not?
It's their right to do so, to not distribute lies and content that's inflamatory if they don't want to.

If they wanted to censor it they should not have aired any of it. And what makes you think the cencored contents were lies and inflamatory? If you really believe that then don't watch TV shows such as "Saturday Night Live".

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

I suppose you could use an external program to time it, but it would have a problem too in that it takes some time for one program to spawn another program so you would not be gaining anything. Calling the clock() function executes very quickly and would not throw off the timings very much if you execute the algorithm numerious times (such as a thousand times or so) before executing the clock() function again.

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

>> What do they contain after executing a nonarithmetic instruction such as MOV
The same thing that it did before the instruction.

>>What if there was an arithmetic operation in a nonarithmetic instruction
Don't know -- but you could use a debugger to find out.

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

I'm not sure it's world famous, but there's this one.

"These aren't my pants!" (Commonly uttered by crooks who've just been caught with the evidence in their pockets.)

LOL And do you know that from personal experience :)

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

I wouldn't have lisened to that with or without the lyerics but I agree that AT&T should not have censored out thouse lines. Maybe the webcast editor will get canned or at least disciplined. Don't know if its grounds for a lawsuit or not.

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

use clock() to get the time before starting the algorithm and again afterwards, then subtract the two times. For example

clock_t start = clock();
// do something, such as call a function
clock_t end = clock();
clock_t diff = end - start;
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

what were the build errors ?

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

>>but it would seem to me that you just made a rough grab for the 2 to 3 billion year thingy.

Yes of course I did. I'm not quite that old and there are no historical records to indicate otherwise. It just seems obvious that there have been many many periods like this over the life of our planet.

>>wrong again. go to the following page
I never claimed to be perfect. It certainly isn't the first time I may have been wrong, and certainly won't be the last. Not see -- you ain't going to get a big raise out of me because I don't play that game. :)

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

If we only consider volcanoes vs humans -- 3% volcanoes and 98% humans according to this study.

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

>>my compiler behaves abnormally

:scared: what does it do ? blow up or something very nasty ?

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

win32 api does not have equivalent of fgets(). It only has like fread() and fwrite(). You are much better off by sticking with standard C functions in stdio.h or use c++ functions in <fstream>

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

can one of you perhaps explain to me exactly why you believe global warming to be a natural event? especially since consensus amongst scientists is that it is a manmade event?
.

Simple -- its been going on for about 2-3 billion years now. And scientists have found evidence of it on other planets too (or so I heard on the radio within the past couple weeks).

>>since consensus amongst scientists
The only consensus is that there is no agreement. Ask 5 different scientists and you will get 5 different answers.

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

you have to understand a little about assembly programming. REGS is just a union on some integers that the function int86() uses to set up the microprocessor's registers before executing the interrupt instruction. google for dos interrupts and you will find this among many others.

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

>>What do you guys/gals think
I hate it because it does nothing more than obfuscate the program. Maintainability and readability are more important than cuteness.

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

post more code including how you declared matrix and swap variables.

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

Not simple. The code tags are messing up the code indenting when I do that. I then have to edit again to fix that.

My guess is that you are using tab characters as well as spaces. All editors screw up the code when you mix tabs and spaces like that, its not just DaniWeb. Set your original code editor to use only spaces and not tabs, that will probably fix the problem, I know it did mine.

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

Please move this topic to there.

Thank you!

I'd suggest you start a new thread there so that the mods won't snip out your URL :)

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

>>Also im trying to find out if keil compiler supports vc++, since i know that sql can be connected using this language...

vc++ is NOT a computer language -- it is a compiler.

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

>>These are not C standards
you are right -- getch() is non-standard, but flushall() is. Its declared in stdio.h.

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

I'd say you have a very big problem then. If the sql server is running on another computer (which it probably does) then your microcontroller and the hardware it runs on will have to support sockets and have a lan card, much like a pc that's connected to a network. If your microcontroller does not support that then you are SOL.

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

you can not use strcat() on the pointer returned by getcwd() because _getcwd() allocates a buffer only large enough to hold the path. You need to allocate a second buffer that is large enough to hold the string returned by _getcwd() and the string you need to add.

The second problem with the solution you have is that depending on the current directory the final string may contain the wrong path too if _getcwd() returns "c:\debug\root1\root2" then your strcat() will result in "c:\debug\root1\root2\root1\root2\test.dll". Your program needs to verify the string that was returned by _getcwd() to make sure you don't strcat() duplicate text.

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

line 5: swap should not be an array but a simple integer, like this:

int  swap = matrix[m][k];

then line 8:

matrix[m+1][k] = swap;

and don't forget to change line 9 too.

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

maybe its just me -- I rebooted my computer and the problem went away. Oh well. Thanks anyway :)

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

Every time I click on a thread the browser's (IE7) horizontal scroll bar is placed at the far right and I have to move it back to far left so that I can read the post. It doesn't happen at other websites -- just DaniWeb and I've only noticed the problem in the 24 hours or so. Anyone else notice this?

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

we have a board for website reviews. Please post there.

And Welcome to DaniWeb.

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

Please turn off that caps lock key -- IT ISN'T NECESSARY TO SCREAM AT US.

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

I Think There Is Some Inbuilt Function Which Has Same Name As Yuor Square Function. So Try The Same Program By Changing The Name Of Square Function

Please don't capitalize every word in the sentence. It makes your post look childish and ridiculous.

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

My guess is that you are passing the wrong data types to the function probably for the first parameter. Make sure the first parameter is unsigned int and not something else.

>>When I run the program I get this
No you don't -- you will get that error at compile time, not runtime :)

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

OMG! Does your keyboard have problems?? Instead of making so many posts why don't you just hit the EDIT THIS POST button?

>>If you were me what would you do next?
I would get a girlfriend and go on an extended vacation :*

iamthwee commented: Flippant and irrelevant comment. -2
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

here's what the functions would look like

double sumArray(double a[LOCATIONS], double& totalSales) 
{

}

and here is how to call it from main () on line 44. And don't forget to change the function prototype on line 12 too.

sumArray(a, totalSales);

BTW: you should name arrays something other than one-letter names.