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

The smallest possible array size would be 19 because the last number read does not need to be placed in the array.

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

Try it and find out for yourself.

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

Please do not tell us you are putting that code in a header file ???? Functions do not go in header files, but only in *.c files. Only put function prototypes in header files.

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

Here is how to do it

for(;;)
{
    read post #5;
}
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

std::string.length() returns a size_t (unsigned int) and you are comparing it with an int. Change variable i from int to size_t to fix the warning.

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

Or maybe not.

Huh? How does that link relate to this discussion?

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

A literacy test would only work for people whose native language is English. Non-English speaking people might have a difficult time to meet the requirements.

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

You can get a Dell computer for under $500.00 USD at Wal-Mart. Or go online at www.walmart.com to see other models. Sorry is this post seems spammy, but I'm just answering the original post.

Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster
empObjPtr->firstName = local_fname;
empObjPtr->lastName = local_lname;

You have to allocate memory for firstName and lastName then copy the strings into those two variables. Since this is c++ you should use std::string instead of char*. But if you have to use char* then this is how to do it:

empObjPtr->firstName = new char[strlen(local_fname)+1];
strcpy(empObjPtr->firstName, local_fname);

Then don't forget to delete that memory before the program ends.

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

you can not pass a single character to that function because the function expects a string. Change the function parameter from std::string to char if you want to pass it a single character.

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

just use sprintf() to generate a new filename

char filename[255];
int i;
for(i = 0; i < 10; i++)
{
    FILE* fp;
    sprintf(filename,"file%d", i+1);
    fp = fopen(filename,"w");
    // blabla
}
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

start your research here.

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

need help with ac++ problem

We are not mind readers!

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

Ok I sended an e-mail to <snip email>. Maybe however someone here will undertake this task.

Possibly -- but you might have to pay them. Post your offer here.

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

remove the const keyword in the parameter to that function on line 99. const does not allow the function to call non-const methods of the class.

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

Nice one :) Its not even a real video but just the picture of the video page they turned upside down.

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

Is there any way to check posts per day now apart from the obvious add up the days and do the maths?

You are right -- post count per day is completely gone now. Interesting statistic, but beyond that not very useful.

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

Yes, but that requires an extra click! :(

Not much of a difference. But I used it for the following. :)

if(user_has_not_used_code_tags) {
	if((todays_date - user_joined_date) > 50) {
		//old user; negative rep + the reason for it
	} else {
		//new user; Please use [code ] tags.
	}
}

Bah! nevermind. I will use postcount for the same from now on!

Well, this is how I code it

if(user_has_not_used_code_tags) {
	if((users_total_post_count > 5) {
              if( warning_previously_issued )
                     issue_infraction;
             else
                     issue_warning;
	} else {
		//new user; Please use [code ] tags.
	}
}
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

I didn't like it. Now, everything comes one after another and if we divide the screen into left and right, all the information is aligned towards left !
Social network seems ordinary (the previous one was better).

And yes, posts per day is missing. Even 'joined date' is missing while posting a reply.

You can always click on the avatar to see that information. When posting a reply what difference does the join date make?

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

moved

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

you will have to post the function converter() because we have no idea what it does or what it returns.

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

Did you read the threads in DaniWeb Community Feedback? There are a couple threads on that topic.

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

Also, when does the value of j ever get reset to 0? j needs to be incremented from 0 to maxj and then reset back to 0. In the meantime the value of i should not change. Something like this:

for(i = 0; i < maxi; i++)
{
    for(j = 0; j < maxj; j++)
    {
         fscanf(...);
    }
}

Another way to do it is to use fscanf() as the loop controller

int i = j = 0;
while( fscanf("%f", &arr[i][j]) > 0)
{
    j++;
    if( j == maxj)
    {
        j = 0;
        i++;
    }
}
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

line 18: C language requires all variables have to be declared at the top of the block. So you need to move the declaration of arr up to about line 8.

arr = malloc( maxi * sizeof(float*) );
       for ( i = 0 ; i < maxi ; i++ ) {
       arr[i] = malloc( maxj * sizeof(float) );

There are other ways to do the above, but this is the one I find most convenient.

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

Sorry, I have no idea how to do it either.

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

>>1>c:\users\vypr\documents\project0809\Board2.h(19) : error C2061: syntax error : identifier 'boolean'

There is no such keyword as boolean -- its bool

[edit]what ^^^ he said too :) [/edit]

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

I guess even this thread is acting the same way ?
http://www.daniweb.com/forums/post830784.html

P.S. Works fine in IE6 and Chrome.

That one looks ok to me using FF 3.08. I made my comment in SOS's post because I thought he did that intentionally. But apparently he didn't.

[edit]Aaaaaaa! SOS's post is fixed not for me too :) [/edit]

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

Yes.

Yes you know or Yes it was an intended change :)

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

hmm, those will be the same standards that took a perfectly reasonable language and loaded layer after layer of garbage on the top such that "Hello World" which used to be 5 lines long and exe at 20K is now well over 150 lines and makes an EXE of almost 1MB.

Its quite obvious you don't know what you are talking about. Hello World is still just a few lines long, and release build compiles down to 8,704 bytes, less than half the size of your 20K program.

#include <iostream>
int main()
{
    std::cout << "Hello World\n";
}

My applications require speed, up till now I have used Visual Basic as an interface and built (C DLL's to control production process hardware (under Win98) .

That's an oxymoron statement!! You can't get speed out of VB or Win98. Come into the 21st Century by upgrading hardware and os to XP.

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

I compiled (VC++ 2008 Express) and ran your program -- worked for me. Please post the data that you entered for each question. Maybe its a problem with your data entries.

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

See the man pages spawn() family of functions.

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

use a compiler for pc and use the pc as emulator. Of course that may not be possible depending on your program.

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

Post your program, just repeating what I posted is useless.

[edit]Ohh I think I see it -- remove that & sysbol in front of &res... scanf("%d",res[i].res_type); [/edit]

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

You may have physically placed the libraries in those directories, but did you tell your compiler that it needs to look for those libraries ? I don't use Borland compilers so I don't know how to do that. Maybe in project setting somewhere.

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

plugin could mean anything you want it to mean. This is like telling an auto repairman "My car is broke, how can I fix it?". Not much information to go on now is there???:?:

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

The change I posted previously meets the requirements that you just posted in bold. You will have to make similar change to the mammal implementation that you posted.

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

When would you use string vs. char arrays?

Almost always, unless you are instructed to use character arrays. When you are taking a course in c++ language your instructor may require you to use character arrays for the educational value of learning how to use them.

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

The post #5 is actually incorrect because it uses travel_time which is the name of the function as if it were a variable name. You need to create another double variable and return it, like this:

double bat::travel_time (double distance, terrain_type t)
{
     double result = 0.0;
     switch (t)
      {
            case PLAIN: result = (distance/airspeed);
                        break;
            case HILL:  result = (distance/airspeed);
                        break;
            case MOUNTAIN: result = (distance/airspeed);
                        break;
                      
     }
     return result;
}
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

It might depend on the compiler -- Microsoft eVC++ for PocketPC contains an emulator. What compiler are you using?

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

Yuuuuk! Impossible to read this.

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

Look at post #5 and compare it with yours. You are missing the part to the left of the = symbol.

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

Does he give you good grades? If he does, then you are probably heading in the right direction. Listen to his criticisms and learn how to do better the next time. If your school offers a course in logic, then take it. Also take all the math courses you can because they too will teach logic. And don't forget to take other courses too, such as science, English and history because they will make you a more well-rounded person and help you get in college. Computer programming is not done in a vacuum but in conjunction with a whole host of subjects.

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

This project can only be compiled with Borland compilers because of all the Borland-specific code it contains, and I don't have that compiler. Sorry, but I can't help you with this.

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

You have more posts than I do, but the same number of stars (10). I have the max number of rep squares (10) -- they just get darker color as more rep is received.

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

please check this listing file mentioned below, it does have any funtions.
what should i do now to calculate execution time??
my first step is to sum up all the clock cycles from instructions.
what is my next step??how will i know the execution time from clock cycles?? i am using HC08 compiler it has 8MHz CPUstandard bus frequency

The next step would be to look up the cpu cycles in an assembly language book, or probably on-line. But I honestly don't know why you would want to do this, unless of course it is your class assignment. Nobody in his right mind would do it for rea-world programs.

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

so what should i do now?
i sum up the instructions and use clock() function to get the time???

No -- just forget the idea of summing up the clock cycles.

in the previous reply you told to insert the code in between the clock() function. what code should i write their?

whatever code you plan to measure!

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

1) There is no function

#include <iostream>
using namespace std;
int main()
{
   // your code here
}

2) Line 9 is an incomplete if statement. if( <some condition goes here> ) { . If you don't want an if statement then just delete line 9.

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

exactly like you would any array of objects, such as an array of its. Note that the first two parameters of the format string need to be %s, not %c because %c only allows entry of a single character while %s allows entry of an entire word. You should also be aware that scanf() can cause corrupt memory because it does not do a bounds check, such as if you are entering the manufacturersID but type more then IDLEN characters.

struct TransistorRec {
	char manufacturersID[IDLEN];
	char polarity[POLARITYLEN];
	float power;
	float gain;
	int stock;
};

int main()

{
	int total,i;
	TransistorRec a[10];

	

	printf("How many transistor in stock?  ");
	scanf("%i",&total);

	for ( i = 0; i <total; i++){
		printf("Enter manufacturer's ID, polarity, power, gain, stock :\n");
	scanf("%s %s %f %f %i",a[i].manufacturersID,a[i].polarity,&a[i].power,&a[i].gain,&a[i].stock);
	}

	return 0;
}
Ancient Dragon 5,243 Achieved Level 70 Team Colleague Featured Poster

>>CPU clock cycles = no of instructions * cycles/instruction
That won't work even if you did manage to get all the cycles. It's not the "number of instructions" because each instruction has a different number of clock cycles. You would have to add up all the instructions in the program, including function calls such as printf(). And I don't think that would be possible unless you have the source code for those functions. And then it would depend on what compiler you used because each compiler might compile the same source code down to different machine-language.

>>but i am not sure, if this method will give me execution time.
Probably not. See my previous post for use of clock() function to measure execution time which will include all function calls.

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

I just heard on the news that the officer apologized to the man and his wife, they accepted. The officer has been placed on administrative leave pending investigation.