Forum: C++ 9 Days Ago |
| Replies: 4 Views: 139 How do those hexadecimal numbers store? do they store as integer or string? |
Forum: C 14 Days Ago |
| Replies: 4 Views: 272 Your isPrime function will return 0 for even-number and return 1 for odd-number because your loop always end at the first loop (because you always return a value at the first loop.)
Try this one... |
Forum: C++ 17 Days Ago |
| Replies: 4 Views: 393 Well, maybe you didn't get my message from my post at all. First index of an array is 0. xData[xMax - xMin] equals to xData[20] because xMax - xMin = 20. So allowed index should be in range of 0 to... |
Forum: C++ 17 Days Ago |
| Replies: 4 Views: 393 int xMin = -10;
int xMax = 10;
double xData[xMax - xMin];
xData contains 20 elements starting from 0 to 19.
int counter = xMin;
for (counter; counter <=xMax; counter++) { |
Forum: C Sep 21st, 2009 |
| Replies: 10 Views: 417 If I am not wrong, it is logically correct. |
Forum: C Sep 21st, 2009 |
| Replies: 10 Views: 417 You don't understand the code or the code does not work properly? It seem to work properly for me. |
Forum: Geeks' Lounge Sep 21st, 2009 |
| Replies: 15 Views: 624 |
Forum: C Sep 21st, 2009 |
| Replies: 7 Views: 434 For those who are lazy to search through internet here is the link: gets() vs fgets() (http://faq.cprogramming.com/cgi-bin/smartfaq.cgi?answer=1049157810&id=1043284351) |
Forum: IT Professionals' Lounge Sep 20th, 2009 |
| Replies: 15 Views: 1,304 I speak C/C++, VB6.0, and some assembly. |
Forum: C++ Sep 20th, 2009 |
| Replies: 82 Views: 15,793 May I add another algorithm that does not use log and power function; yet still run relatively fast. This function makes use of fast inverse square root algorithm... |
Forum: C++ Sep 20th, 2009 |
| Replies: 6 Views: 1,498 It is hard to suggest any project when we don't even know what have you learned and what are you capable of. |
Forum: Community Introductions Sep 20th, 2009 |
| Replies: 2 Views: 163 Don't ever bump into Daniweb again. I swear you will never see a light again if you do. Joking :twisted: |
Forum: Community Introductions Sep 20th, 2009 |
| Replies: 5 Views: 262 It is nice to have ambition. Welcome to daniweb.com. |
Forum: C Sep 18th, 2009 |
| Replies: 3 Views: 603 We don't do homework for you. |
Forum: Existing Scripts Sep 16th, 2009 |
| Replies: 1 Views: 795 I am looking for an article publishing script that support multiple-pages articles similarly to devpapers.com. I have searched for many scripts already and all of them are only able to post an... |
Forum: C Sep 14th, 2009 |
| Replies: 7 Views: 745 I am greatly disappointed. |
Forum: Community Introductions Sep 9th, 2009 |
| Replies: 2 Views: 130 Looking forward to see your next post. |
Forum: C Aug 30th, 2009 |
| Replies: 2 Views: 347 I have finally found the solution to my problem, so I am going to share it to anyone who interest the same thing as what I am
int main()
{
// allocate 8 bytes for storing machine code... |
Forum: C Aug 30th, 2009 |
| Replies: 19 Views: 947 Don't mess with Narue. Look at her avatar, you will get some idea :sweat: |
Forum: C Aug 29th, 2009 |
| Replies: 4 Views: 349 All your code do is assigning each element of your matrix to -1 and then display them. It is no surprise at all that you did not achieve the assignment because you haven't figured or aren't willing... |
Forum: C Aug 29th, 2009 |
| Replies: 2 Views: 347 Recently, I have wonder how to execute machine code instruction from memory in C/C++. I am aware of data execution protection. Anyway, I have this piece of code:
int main()
{
// allocate 2... |
Forum: C Aug 22nd, 2009 |
| Replies: 11 Views: 941 Ouch! Didn't know this trick before |
Forum: C Aug 22nd, 2009 |
| Replies: 11 Views: 941 Took me 5 minutes to indent your code
/*This program removes duplicates from a sorted array of integers*/
#include <stdio.h>
#include "genlib.h"
#include "simpio.h"
#include "strlib.h"... |
Forum: Visual Basic 4 / 5 / 6 Aug 9th, 2009 |
| Replies: 4 Views: 602 I have not seen any significant disadvantages of using control array except it slightly increase difficulty in managing your controls. Moreover, control array is not applicable in every program. |
Forum: C Aug 6th, 2009 |
| Replies: 18 Views: 572 To be honest, it is hard to read your code without know the clear purpose of what your function intent to do. It would be easy if you tell us what will your function return, what each parameters do,... |
Forum: Visual Basic 4 / 5 / 6 Aug 6th, 2009 |
| Replies: 4 Views: 602 Control array simply is a group of control that share the same name, same type, and same event procedures that increase flexibility of Visual Basic 6:
Being share the same name and same event... |
Forum: Computer Science Aug 5th, 2009 |
| Replies: 16 Views: 1,010 Learning AI is already existed except it is built to serve their specific purpose. I haven't seen any learning purpose-less AI. |
Forum: C Aug 5th, 2009 |
| Replies: 18 Views: 572 1. Why create this function when you can simply compare two characters with operator ==.
int Check_Characters(char s1,char s2) {
if(s1==s2)
return 1;
return 0;
} |
Forum: C Aug 5th, 2009 |
| Replies: 3 Views: 279 Or another faster way is using modulus operator.
Pseudo code:
For i = 0 To 3
Print i % 2
Next i
Result:
0 1 0 1 |
Forum: C++ Aug 4th, 2009 |
| Replies: 24 Views: 760 My bad :(
You are totally right. |
Forum: C++ Aug 4th, 2009 |
| Replies: 24 Views: 760 You can't simply compare 2 strings with operator ==. There is a function in library <string> called strcmp().
Syntax:
int strcmp(string1, string2)
Return:
Return 1 if string1 >... |
Forum: C Aug 4th, 2009 |
| Replies: 7 Views: 377 You can also use temp as char array, but you don't know how much element you need for your new string... |
Forum: C++ Aug 4th, 2009 |
| Replies: 3 Views: 197 Sorting concept is simple: from the least to the greatest or from the greatest to the least. To do so, you need to do comparison. So, the magic trick is comparison-rule (which is greater and which is... |
Forum: C Aug 4th, 2009 |
| Replies: 7 Views: 377 Here is your code and its logical error.
int RemoveChars(char *S,char c) {
int i=0;
int spaces=0;
char temp;
for(i=0;S[i]!=0;i++) {
temp=S[i];
if(S[i]!=c) {
... |
Forum: C Aug 3rd, 2009 |
| Replies: 34 Views: 1,203 I am at my workplace right now, so I don't have any compiler to test. However, I see several things that could cause some errors.
Firstly, End=S+1;, it should be End = &S[i] + 1
Secondly, int... |
Forum: C Aug 3rd, 2009 |
| Replies: 34 Views: 1,203 Now that I don't really understand what you want for your *num. Here is what I understand before:
If I have string "Hello World", and my c is 'W'. so the *num would be 7 because letter 'W' is the... |
Forum: C Aug 3rd, 2009 |
| Replies: 34 Views: 1,203 As I have mentioned before, your code keep reset the *num to 0. To solve this problem, you need to remove the code where you reset *num:
char *Strchr(char *String, char c, int *num)
{
*num... |
Forum: C++ Aug 3rd, 2009 |
| Replies: 5 Views: 1,326 You can also use smart-pointer technique.
template <class T>
class auto_ptr
{
private:
T* ptr;
public:
explicit auto_ptr(T* p = 0) : ptr(p) {} |
Forum: C Aug 3rd, 2009 |
| Replies: 34 Views: 1,203 Sorry, I was mistaken about the increment (I was at workplace where there was no compiler to test). I'm surprised that:
*b++ and *++b get the value of the next address and also increase the... |
Forum: C Aug 2nd, 2009 |
| Replies: 34 Views: 1,203 It is difference. Let start that you string "Name". The first character of the string is 'N'. so *string++ is 'O' and next time *string++ will become 'P', 'Q', 'R', 'S'..... 'Z'....
What you want... |