So what have you managed to achieve so far (apart from not reading the introductory threads at the top of the forum).
We're here to help, not give you answers right off the bat.
So what have you managed to achieve so far (apart from not reading the introductory threads at the top of the forum).
We're here to help, not give you answers right off the bat.
> This partition should be usable for booting purpose.
If it's virtual, then it will only exist while part of your s/w is running.
At bootup, NONE of your code will be running, so how could you ever boot from it ?
Yes, we got that much of the problem already.
The question is, did you just put bool isMemberOf (int val);
into the class declaration, without bothering to implement it, or have you tried to implement it and gotten some error messages.
http://msdn2.microsoft.com/en-us/library/aa363858.aspx
Scroll down to Communications Resources
You can access COM and LPT ports using the standard win32 API, which Dev-C++ supports.
It still lacks that "indented" quality which makes reading more than 5 lines of code a lot easier.
So where is currencyconvert.cpp ?
That's it?
You're not going to even tell us a little bit of how your robot is attached to your PC?
> on these results few teachers said it is the problem of compilers.
No, it's a problem with the teachers not knowing the language rules well enough.
For C and C++, multiple side effects on the same variable has ALWAYS BEEN UNDEFINED.
What does that mean, it means the compiler is free to interpret it however it wants (or maybe even not at all). Any answer you get is just like rolling a dice.
http://c-faq.com/expr/index.html
- my answer is -256
- your answer is -257
- his hard disk has been reformatted.
As for Java, I've no idea whether the Java standard makes any claims about the evaluation order. It's certainly not comparable to C or C++.
The bottom line is that the code is broken. Don't use such constructs in your program, and don't waste time trying to figure out the mysteries of how your compiler seems to work.
So what 'port' is your robot plugged into?
- Serial
- Parallel
- USB
> My question is ,is it really addres or i am wrong informed
All x86 processors have a large amount of memory address space (where your program runs from), and 64K of I/O space (where all the attached devices live).
In all modern operating systems like XP, direct access to the I/O space is not allowed, as any incorrect use of the hardware can seriously compromise the machine.
Under normal circumstances, to access the hardware you would have to go via one of the standard drivers which come with the OS. So, if you're using a standard interface, a lot of the basic stuff is already done for you.
Using a C compiler to compile C++ code.
The compiler driver will correctly invoke the correct compiler, but will fail to add on the correct libraries.
What command other than 'cc' should you use?
Boolean operators evaluate to 0 (false) or 1 (true).
So depending on the outcome of that, you have
z = 2 * x + (0);
z = 2 * x + (1);
> i am about to start my final year project
Are you on the course because you wanted to be, or because someone told you to take it?
Is there nothing which has ever taken your interest, or have you just blindly done the assignments because they were in the way of your social life?
People who create the future don't go round asking "what should I do on my final year project".
1. Write it in C
2. Compile with "gcc -S prog.c"
3. Inspect prog.s to find out how the compiler does it.
4. Figure out how you should have passed the ADDRESS of input and returnkey to the function.
5. Does .word really reserve the same space as an int in C ?
6. Do you need a .align 4 in front of your input declaration ?
It's quite rare to see a first-time poster use code tags correctly.
It's rarer still to expect the code to be indented in any meaningful way.
In pseudo-code
Intersection
for e = each element in l1
if isElementOf(l2,e) then add e to the result
Union
copy l1 to the result
for e = each element in l2
if NOT isElementOf(result,e) then add e to the result
And now you're uploading files which are not ZIP files, but presumably renamed from some other less common archive format.
Helping you is just too much effort, and I've got better things to do than download more packages just to help you.
Like I said, a function called "isMemberOf" would be a really useful primitive for working out intersection and union
// return true if val is in the list
bool linkedList::isMemberOf( int val );
If you're serious about programming, then you're going to end up learning several languages in some detail, and at least be familiar with a good many more.
Learning to program is like learning to drive.
Having learnt to drive, whether you then choose a Ferrari, an MPV or an 18-wheel big-rig really depends on what you're trying to do. For some jobs, it's pretty obvious what kind of vehicle (or which programming language) you should be using. For others, its down to skill and judgement.
Languages are just tools, much like a hammer, saw and chisel are tools to a carpenter. The rest is the skill in the hands of the user as to whether a work of art emerges, or a stay in casualty.
So what you really want to start with is something simple like "isMemberOf".
A union is merely a membership test to see if the item is in either list.
An intersection is a membership test to see if the item is in both lists.
How much of the list functionality do you have already, say
- create a list
- insert into a list
- remove from a list.
These are all basic functions which you'll need. If you can't do that much, then we need to help you with those rather than going straight for the complete solution.
Apparently, I was talking to myself when I said this
> Oh, and before you post more code, figure out how to use code tags by reading the intro
> threads, and paying attention to the watermark at the back of the edit window.
> also, just a note you can do this to store up to n charictors in a row.
Simple char arrays are no match for a C++ string in a C++ program.
I think you need to post some more code.
You don't need a browser just to read HTML from a website.
Perl is good.
PHP might be better.
> Why and can I do anything for removing?
Try using 0 if you want to fetch the message
PEEK implies look at the message, but DON'T remove it. You got what you asked for.
The other problem is, having filled your buffer with \0, if recv() also fills the buffer with data, then there will be NO \0 at the end, and thus it will not be a proper C-style string.
Oh, and before you post more code, figure out how to use code tags by reading the intro threads, and paying attention to the watermark at the back of the edit window.
If your code doesn't look like this, expect a less than positive response.
char* buff = new char[len];
memset(buff, 0, len);
if(recv(sck, buff, len, MSG_PEEK) == SOCKET_ERROR) {
cerr << "String Receive Error - code: " << WSAGetLastError() << endl;
}
Well you can.
There is such a thing as "fixed point" arithmetic, but there is no native support in the language to implement it.
You would have to implement your own class, overload things like +, *, = and then write your own trig functions to make use of the mathematical primitives.
Well you could start with writing in English, and not cryptic SMS-speak.
http://www.catb.org/~esr/faqs/smart-questions.html#writewell
Post your attempt, and we'll help you fix it.
You can't calculate to 2dp using floating point.
Printing to 2dp is achieved by using I/O manipulators.
http://www.cplusplus.com/reference/iostream/manipulators/
I agree - close and forget about it.
> mainmenu(); // return to caller
No it doesn't, it calls it once more.
So eventually, you end up with
mainmenu calls income_menu calls mainmenu calls income_menu calls mainmenu calls income_menu calls and so on.
Keep going long enough, and you'd run out of stack.
If you want to get back, it's just return;
An ounce of keeping your mouth shut is worth a ton of explanation.
Post the code which
- creates nodes
- adds them to the list
- prints the list.
There's nothing strange when it's implemented correctly, so I'm just going with there are bugs in your code.
Does it involve maintaining a separate temporary list of 'n' nodes?
Keep it in English please, not cryptic SMS speak
http://www.catb.org/~esr/faqs/smart-questions.html#writewell
Create a small test program which just calculates the sine of 180 degrees, and show us that it doesn't print 0 as a result.
Then post that WHOLE program (not random snippets where you think the problem is), then perhaps we can explain what is really going on and what you can really (perhaps) do about it to solve the problem.
For one thing, you've never stated what value of pi you're using.
Please stop using void main.
> are those console or 2D codes?? mind sending em my way??
Did you read the dates of those posts?
Reading their profile, it says "Last Activity: 10th Apr 2004".
I've got a new game, it's called "thread bumper 2007" :icon_rolleyes:
Probably (ie, due to your crappy indentation) because the case is OUTSIDE the switch.
This is good. All the cases and braces line up, and you can instantly tell the structure of the code simply from following the indentation.
switch ( foo ) {
case 1:
switch ( bar ) {
case 1:
}
}
This is bad. Trying to save a couple of lines of source by compressing multiple braces leads to all sorts of trouble.
switch ( foo ) {
case 1:
switch ( bar ) {
case 1:}}
Top tip:
Write all the control structures from the outside in.
Eg.
for ( ; ; ) {
}
Having got the structure of the for loop correct, then you can move the cursor and fill in the detail. Sure it's a few extra key presses, but it sure saves hours of playing "hunt the missing brace, then post on a message board".
So in your example, you would start with
switch ( choice ) {
case 1: {
}
break;
case 2: {
}
break;
case 3: {
}
break;
default: {
}
break;
}
Also in your case, you need to break out the functionality of your cases into separate functions, so your main() doesn't grow to such monstrous proportions.
It works for all the other bits of syntax which need to be balanced, such as "" () and /**/
Yes, use a std::vector instead.
1. Why are you still messing about with such an old compiler?
2. Why (oh WHY) are you trying to write assembler in your C programs.
What lesson are you meant to be learning, futility?
How about posting some real examples we can look at rather than you just saying "it doesn't work".
> How many bools can I connect??
As many as you like
> How many bools SHOULD you connect?
Usually a lot less.
One set of && and one set of || is about the limit of what would be easy to understand and test for.
If you were being pedantic, each bool you add DOUBLES the number of tests you need to perform in order to prove the code is correct. If you get too creative, there's no way that you can test the code.
People who fish for compliments catch them in shallow water.
Well which operating system / assembler / tools are you using at present?
A debugger needs to be pretty well matched to what you have in order to work effectively.
Posting your error messages as well would be a big help.
> I have no idea what the problem is.
And I gave up caring about the "me me me" attitude of the OP with the constant bumping, and the not reading the forum rules, or caring enough to format the code.
Too much effort, too little reward.
How about you learn to read to begin with?
Lets say, the forum rules.
Or how to post code using code tags
Or maybe even the watermark at the back of the edit window.
Or (gasp, shock, horror) using the preview post feature to make sure what you spewed forth was actually readable.
23 posts, and you STILL haven't figured that out - sheesh!