Search Results

Showing results 1 to 40 of 273
Search took 0.02 seconds.
Search: Posts Made By: Sci@phy
Forum: Assembly Nov 23rd, 2008
Replies: 2
Views: 548
Posted By Sci@phy
If you are running it under Windows XP CMD than it will only affect that window, because XP just simulates command prompt, doesn't load real one.
So, answer to your question, if you are running XP,...
Forum: C++ Nov 13th, 2008
Replies: 8
Views: 414
Posted By Sci@phy
I'm stunned. Can somebody tell me if bracket section alone is by C/C++ standard?
Because, DevC++ mingw and Visual C++ Express 2008 both compile and execute properly:

#include <iostream>

int...
Forum: C++ Nov 13th, 2008
Replies: 8
Views: 414
Posted By Sci@phy
AFAIK brackets can be used without any function or if statement, simply as code-block.
They just come in handy for functions, classes, etc.
Forum: C Nov 13th, 2008
Replies: 13
Views: 784
Posted By Sci@phy
Please post entire code, because your code should work then.
Forum: C Nov 13th, 2008
Replies: 13
Views: 784
Posted By Sci@phy
You have to do it for EACH i.
So put it in for loop
Forum: C Nov 13th, 2008
Replies: 13
Views: 784
Posted By Sci@phy
Oh, yes... Your temp is actually same memory space as ptr. So:

temp[0] = ptr[99]
...
temp[99]=ptr[0]

But ptr[0] is temp[0], which is actually ptr[99]

You have to make a REAL copy of ptr to...
Forum: C Nov 13th, 2008
Replies: 13
Views: 784
Posted By Sci@phy
I apologise, my bad (still early in the morning here :) )
I just realised that you decrease ptr_size2, not ptr_size, so it shouldn't be problem there.
Forum: C Nov 13th, 2008
Replies: 13
Views: 784
Posted By Sci@phy
I only gave you an idea... Probably I messed up some interators, so in some point you call temp[negative]...
Check for this, it shouldn't be hard
Forum: C Nov 13th, 2008
Replies: 13
Views: 784
Posted By Sci@phy
Problem is you are going both ways!
You are incrementing i iterator and at same time decrementing ptr_size2.
Write something like:

ptr_size2 = ptr_size;
temp = ptr;
while (ptr_size2>=0) {...
Forum: C++ Nov 13th, 2008
Replies: 5
Views: 377
Posted By Sci@phy
What do you really want? How to create Clist? or?
Forum: C++ Nov 13th, 2008
Replies: 9
Views: 903
Posted By Sci@phy
What have you done so far? We don't solve homeworks
Forum: C++ Nov 12th, 2008
Replies: 5
Views: 543
Posted By Sci@phy
What does Earray point to? You've made it to null pointer:
Earray[i] = 0 //like NULL

And your EmpPointer is unused...
Seems like to me you're trying to allocate 2D array of some sort, but doing...
Forum: C Nov 12th, 2008
Replies: 5
Views: 512
Posted By Sci@phy
It works on my Dev-cpp (mingw, gcc) compiler, and I can't see any problem with code, so it's probably something about your compiler.
Forum: C++ Nov 11th, 2008
Replies: 4
Views: 1,012
Posted By Sci@phy
why do you need kbhit? kbhit works more like a detector if key is pressed, it doesn't wait for keypress.
Simply use getch?
Forum: C++ Nov 11th, 2008
Replies: 15
Views: 2,901
Posted By Sci@phy
Please post at least head of your header file...

Until then, this: googleing! (http://msdn.microsoft.com/en-us/library/f6xx1b1z(VS.71).aspx)

says this:
Forum: C++ Nov 11th, 2008
Replies: 2
Views: 1,235
Posted By Sci@phy
Well, you obvioulsy need to increment counter each time you add a node, and decrement it each time you remove a node. It's really not hard, just put it in insert, delete, and create list.

For...
Forum: Assembly Nov 8th, 2008
Replies: 2
Views: 798
Posted By Sci@phy
hmm... write your own mul using logical operators and and or?
I'm a beginner too, so don't really know how, but I'd try something with that

Although it's not elegant solution
Forum: Assembly Nov 8th, 2008
Replies: 0
Views: 506
Posted By Sci@phy
Hi! I have the following code:

mov al, 5d
neg al

When it executes, CF = SF = AF = 1
Ok, I think I understand why
AF (number is bigger than 00001111b ?),
SF (most significant bit is now 1...
Forum: C++ Nov 8th, 2008
Replies: 4
Views: 1,688
Posted By Sci@phy
Make pointer to pointer **ptr, and allocate n pointers to it.
Then to each of that n pointers *ptr[i] allocate n int's (or whatever).
After that you can use it as regular 2D array: ptr[i][j]
Forum: Assembly Nov 5th, 2008
Replies: 1
Views: 485
Posted By Sci@phy
Hello to all of you!
I would really appreciate somebody telling me complete step by step tutorial how to work with MASM (or TASM, but I haven't noticed it's free to download)

I've tried myself...
Forum: C Nov 3rd, 2008
Replies: 10
Views: 767
Posted By Sci@phy
You can drive your car without fastening seat belt, or walk through minefield :)
But it's risky!

So always use int main() and return zero if succesful (in which case you don't even need to write...
Forum: C++ Nov 2nd, 2008
Replies: 8
Views: 657
Posted By Sci@phy
What you wrote will only chage 101'th element of array1 with 101'th element of array2.

To copy arrays, you have to write function that will do that for each element
Forum: C++ Nov 2nd, 2008
Replies: 3
Views: 334
Posted By Sci@phy
Let's say you have arrays:
int arr1[N], arr2[N];

Then arr1 and arr2 are actually pointers to first locations in arrays, so this would be true:

arr1== &arr1[0]
&&
arr2==&arr2[0]
Forum: C++ Nov 2nd, 2008
Replies: 3
Views: 754
Posted By Sci@phy
If I'm not mistaken, fillellipse draws standard (unrotated) ellipse, and there's nothing you can do to rotate it. You could try to draw your own ellipse, and then do something with that...
Forum: C++ Nov 2nd, 2008
Replies: 3
Views: 446
Posted By Sci@phy
Using '%' and '/' should be sufficent. First take a modulo 10 of number (and that is your last digit), then divide number by 10 (and you are left with number without last digit). And put that somehow...
Forum: C Nov 2nd, 2008
Replies: 4
Solved: Sine Series
Views: 1,143
Posted By Sci@phy
And a little piece of advice. When working with decimal numbers, don't use float, instead use more precise double.
Forum: C++ Oct 31st, 2008
Replies: 2
Views: 507
Posted By Sci@phy
Also, when working with classes that allocate memory dynamically, you HAVE to write destructor that will free all allocated memory!
Forum: C++ Oct 30th, 2008
Replies: 8
Views: 471
Posted By Sci@phy
Oh yes, sorry. I thought minus was problem :)

Check your spelling, and learn how to read errors.
Forum: C++ Oct 30th, 2008
Replies: 8
Views: 471
Posted By Sci@phy
- radius = r;

Hmm...
What's wrong with this code:
-a = 300;
Forum: C++ Oct 29th, 2008
Replies: 8
Views: 596
Posted By Sci@phy
Try to see if the problem is input or your class.
Remove all user inputs from main and put something yourself in it. If it works, problem is only in input.
Forum: C Oct 26th, 2008
Replies: 10
Solved: Trie's in C
Views: 2,225
Posted By Sci@phy
Do you know why do you use typedef?
It's syntax should be:

typedef some huge type A_DEF;


And the code you wrote has no use from typedef since you haven't specified name that will replace...
Forum: C Oct 26th, 2008
Replies: 10
Solved: Trie's in C
Views: 2,225
Posted By Sci@phy
Funny:

typedef struct node {
char value;
bool isroot;
bool isend;
struct node* sibling;
struct node* child;
}; //<== if semicolon goes here, it's much more reasonable
Forum: C Oct 25th, 2008
Replies: 2
Views: 499
Posted By Sci@phy
Forum: C++ Oct 25th, 2008
Replies: 8
Views: 1,141
Posted By Sci@phy
So, that's the thing! I knew something was wrong with it, but still :)
Forum: C++ Oct 25th, 2008
Replies: 9
Views: 560
Posted By Sci@phy
Why don't you check if it's open?

current_file.open(file.c_str());
if (!current_file){
cout<<"File not opened!\n"
return "";
}
Forum: C++ Oct 24th, 2008
Replies: 8
Views: 1,141
Posted By Sci@phy
Glad you've find answer. But this is what you asked (be careful what you ask :) ):
Forum: C++ Oct 24th, 2008
Replies: 8
Views: 1,141
Posted By Sci@phy
Don't know if it helps. I myself am not sure if it's ok to write it, but compiler doesn't complain:

void func(int n){
int a[n];
for (int i = 1; i <= n; i++) a[i+1] = i*i;
for (int i...
Forum: C++ Oct 24th, 2008
Replies: 5
Views: 408
Posted By Sci@phy
d is c++ string object, and printf is C function.
Even more, not only it's C function (it would probably work nevertheless), but you've told it to print integer ( "%d" tells printf to print integer!)
Forum: C++ Oct 24th, 2008
Replies: 9
Views: 560
Posted By Sci@phy
And what exactly is the problem?

You have no syntax errors, and I can't see anything wrong. But i'm sleepy, so maybe I'm wrong...
Please be more specific
Forum: C++ Oct 24th, 2008
Replies: 15
Solved: And or not
Views: 954
Posted By Sci@phy
Ah, now you've said your problem. Solution is simple:
AND && (notice, two & signs)
OR ||
NOT !
Showing results 1 to 40 of 273

 


About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC