Search Results

Showing results 1 to 40 of 146
Search took 0.01 seconds.
Search: Posts Made By: devnar
Forum: C Jan 30th, 2009
Replies: 2
Views: 204
Posted By devnar
1. Construct two matrices.
2. Declare two 1-D arrays called rowAdd and colAdd to hold the values you obtain when you add the row and column elements respectively.
3. Once you find the sum of all...
Forum: C Jan 28th, 2009
Replies: 5
Views: 409
Posted By devnar
That doesn't make much sense. What you said(IF you said what I think you said) can be achieved more conveniently using a loop.
Forum: C Jan 28th, 2009
Replies: 6
Views: 215
Posted By devnar
Hooray for the internet (http://letmegooglethatforyou.com/?q=merge+sort+in+c)
Forum: C Jan 28th, 2009
Replies: 5
Views: 409
Posted By devnar
Use int main(), indent your code, use switch cases and a while loop instead of goto and if cases.
Forum: C Jan 28th, 2009
Replies: 6
Views: 215
Posted By devnar
Your post gave me an adrenaline rush. Honestly!:icon_eek:
Forum: C Jan 28th, 2009
Replies: 11
Views: 523
Posted By devnar
There are quite a lot of mistakes in your program (still!). So instead of pointing out each and every of them, I just whipped up my own code and have offered explanations through comments.
...
Forum: C Jan 28th, 2009
Replies: 13
Views: 714
Posted By devnar
>>Take a C course in some center in your city. WILL help you out...
I think a C course is a waste of time(even when you've got some to spare). I've learned more from the Internet and Daniweb than I...
Forum: C Jan 27th, 2009
Replies: 13
Views: 714
Posted By devnar
I gave you 3 points on which to work on. You didn't bother to make any corrections in your next post or even ask questions about what I had suggested. There are a lot of other fundamental syntax...
Forum: C Jan 27th, 2009
Replies: 13
Views: 714
Posted By devnar
You gotta use code tags for people to consider answering to your post.
Here's the syntax:


.
.
your code here
.
.
Forum: C Jan 26th, 2009
Replies: 8
Views: 830
Posted By devnar
You can also look up RSA (http://en.wikipedia.org/wiki/RSA) or DES (http://en.wikipedia.org/wiki/Data_Encryption_Standard) if you are dealing with delicate data. But they are both quite complicated...
Forum: C++ Jan 18th, 2009
Replies: 1
Views: 184
Posted By devnar
The if statement is wrong. It should be:

if (pow > 1)
{
full = num * full;
return (power(num, --pow, full)); //You've already multiplied once. Don't do it again.
}

Also, your code...
Forum: C Jan 17th, 2009
Replies: 3
Views: 1,188
Posted By devnar
As mentioned before, it makes more sense to make sure that the list is in order while inserting than to apply a sorting algorithm later.

You can try this:

liste_t* Insert (liste_t *listptr, int...
Forum: C Dec 28th, 2008
Replies: 14
Views: 2,369
Posted By devnar
That's wrong. You're allocating memory for only one character. Should be dd[2].


This statement adds the ASCII values of '2' and '3'. So your result will be 50(ASCII value of 2) + 51(ASCII value...
Forum: C Dec 26th, 2008
Replies: 5
Views: 674
Posted By devnar
Use of goto is frowned upon. The only place where it's usage is justified is when you're in a nest of loops and wanna come out of it with the least amount of hassle. As Salem has already suggested,...
Forum: C Dec 24th, 2008
Replies: 11
Views: 899
Posted By devnar
I guess that was a li'l too much information, but he wasn't just asking about the labeling(I thought it would be too obvious a thing to ask). I assumed he was talking about array subscripts. Oh...
Forum: C Dec 24th, 2008
Replies: 18
Views: 1,188
Posted By devnar
Does that ever actually happen? I thought arrays are always assigned contiguous blocks of memory.
Forum: C Dec 21st, 2008
Replies: 7
Views: 877
Posted By devnar
You can use the reference (http://www.cplusplus.com/reference/clibrary/cassert/assert.html) if you aren't sure of how the assert function works. I think in your program, you've to "assert" that the...
Forum: C Dec 21st, 2008
Replies: 18
Views: 1,188
Posted By devnar
What's glblclrtab pointing to? It'll have a NULL value or a garbage value which is causing segmentation fault. After you make it point to a character array, you can use *(glblclrtab+i)= (char) i1; or...
Forum: C Dec 20th, 2008
Replies: 11
Views: 899
Posted By devnar
You could actually do it by declaring one extra row and column for each matrix that you declare. Then you can make the first row and the first column redundant, then do all the operations on the rest...
Forum: C Dec 20th, 2008
Replies: 11
Views: 899
Posted By devnar
What way did I suggest? If you're talking about starting from row 1 by using the for loop I've "suggested", then you're obviously gonna land in trouble since you're skipping the data in row 0(which...
Forum: C Dec 20th, 2008
Replies: 11
Views: 899
Posted By devnar
And you can start a row from 1 just by replacing for (r = 0; r < rows; r++) with for (r = 1; r < rows; r++), but you shouldn't do it(
unless you really know what y-ou're doing) since arrays'...
Forum: C Dec 20th, 2008
Replies: 3
Views: 561
Posted By devnar
It was already explained to you by Ancient Dragon in your previous thread. (http://www.daniweb.com/forums/post759666-2.html)
Forum: C Dec 20th, 2008
Replies: 11
Views: 899
Posted By devnar
The same program works fine in my compiler (code::blocks using GCC). It prints the line "Sum of all elements = %d" too.
Forum: C Dec 19th, 2008
Replies: 5
Views: 677
Posted By devnar
struct sale Weekly_Sale[13];
What you're doing here is creating a user-defined variable called Weekly_Sale of type 'struct sale'. It's logically similar to creating arrays of defined types and you...
Forum: C Dec 16th, 2008
Replies: 5
Views: 1,345
Posted By devnar
You're missing a semi-colon after defining the struct.

Should be:
struct names{ // definitions
-----
----
----
};
Forum: C Dec 16th, 2008
Replies: 5
Views: 613
Posted By devnar
Firstly, your indentation is pretty bad. I lost the flow at the middle of the code.

Secondly, use int main().

I think this is wrong:
if (cMenu = 1); // statment for if cMenu is true

You are...
Forum: C Dec 15th, 2008
Replies: 5
Views: 674
Posted By devnar
Forum: C Dec 13th, 2008
Replies: 6
Views: 565
Posted By devnar
Small correction: The variable 'm' doesn't hold the value of the smallest element, but it holds the index of the smallest element in the array.
Forum: C Dec 13th, 2008
Replies: 6
Views: 565
Posted By devnar
The algorithm in use is selection sort (http://en.wikipedia.org/wiki/Selection_sort)[wikipedia.org]. It's one of the simplest sorting techniques.

It's algorithm is:
1. Find the smallest element...
Forum: C Dec 13th, 2008
Replies: 3
Views: 2,185
Posted By devnar
Read the reply for your previous post and stop trolling around.
Forum: C Dec 13th, 2008
Replies: 5
Views: 929
Posted By devnar
Daniweb isn't a program spewing machine that you can command.
Forum: C Dec 13th, 2008
Replies: 7
Views: 842
Posted By devnar
C language was developed by Dennis Ritchie, but I'm not sure if he's officially recognized as the 'Father of C language'. That said, don't post a thread as if you are at a gun-point. All those...
Forum: C Dec 13th, 2008
Replies: 3
Views: 524
Posted By devnar
After 8 posts, the community expects you to know how to use code tags. Click here (http://www.daniweb.com/forums/thread93280.html)
Forum: C Dec 9th, 2008
Replies: 7
Views: 1,849
Posted By devnar
If you're reading from a text file, you can use fscanf() to read in the numbers. And it's not necessary to prefix the numbers with a 0x, although for convenience's sake, you can.

Ex: Let's say...
Forum: C Dec 7th, 2008
Replies: 2
Views: 598
Posted By devnar
Use code tags for your code

.
.
.
Your code here
.
.
.
Forum: C Dec 5th, 2008
Replies: 7
Views: 1,849
Posted By devnar
I (and probably others too) don't fully understand your problem. How can the following be "working fine" for you?
char * hex = (..dynamically allocated memory with malloc..);

And you haven't...
Forum: C Dec 5th, 2008
Replies: 4
Solved: Timer Function?
Views: 629
Posted By devnar
Here's a useful link (http://www.java2s.com/Code/C/Development/Howtochecktheperformancedifftime.htm)
Forum: C Dec 4th, 2008
Replies: 4
Views: 506
Posted By devnar
This is wrong:
for(i = 0; i < n; i++){
for(j = 0; j < n; j++) printf(" %d", MatrixMult( a, b, c, &n ));
printf("\n");
}

You can't return arrays since they are always passed by...
Forum: C Dec 4th, 2008
Replies: 4
Views: 506
Posted By devnar
Better use fscanf() to read integers. If you use fgetc(), you'll be reading the ascii values of the integers and not their actual values. Also every digit will be treated as a character. How will you...
Forum: C Dec 4th, 2008
Replies: 10
Solved: Word Reversal
Views: 950
Posted By devnar
That's quite a complex piece of code you got there. Since I'm still a beginner it took me quite a while to understand it's logic. I'm just surprised that you could come up with that logic and not be...
Showing results 1 to 40 of 146

 


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

©2003 - 2009 DaniWeb® LLC