Search Results

Showing results 1 to 40 of 275
Search took 0.02 seconds.
Search: Posts Made By: andor
Forum: Assembly May 17th, 2007
Replies: 4
Views: 2,166
Posted By andor
hm this line is bad:

loop3: lw $s0, 0($t9)

The value of t9 is not an address its only 1. So you have illegal address exception. If your next question is why its 1 than the answer is:

...
Forum: C++ May 16th, 2007
Replies: 2
Views: 5,317
Posted By andor
Your problem is not to convert int to char if I'm correct. You only need to check the input with

int isdigit(int character);

link (http://www.acm.uiuc.edu/webmonkeys/book/c_guide/2.2.html)
Forum: C May 9th, 2007
Replies: 14
Views: 2,553
Posted By andor
Forum: C++ May 9th, 2007
Replies: 4
Views: 10,053
Posted By andor
First of all add code tags. Find out why void main and gets are bad. There is many posts about them.
Forum: C++ May 9th, 2007
Replies: 21
Views: 4,554
Posted By andor
you can do this if you dont care for loop order.
The answer you will find if you check the asm for both cases, then U will see for which case is less asm code.
Forum: C May 9th, 2007
Replies: 6
Views: 4,643
Posted By andor
There is no standard way to do that
Forum: C Apr 13th, 2007
Replies: 4
Views: 1,732
Posted By andor
link (http://c-faq.com/expr/ieqiplusplus.html)
Forum: C Feb 9th, 2007
Replies: 3
Solved: C file stream
Views: 5,152
Posted By andor
Yes. With fopen, SEEK_END and ftell you can determine the size of file and after SEEK_SET read the the whole file with fread.


#include <stdio.h>
#include <stdlib.h>

int main()
{
char *...
Forum: C Jan 26th, 2007
Replies: 2
Solved: New
Views: 901
Posted By andor
I'm not shore that I understood your problem.

#if 0
/* you can put here anything and the compiler wouldn't consider it */
#else
/* while this part will be considered */
#endif /* if 0 */
Forum: C++ Jan 12th, 2007
Replies: 3
Views: 2,155
Posted By andor
The g++ is comonly used by linux (but windows also can used for example cygwin emulator). Try this link (http://www.google.com/search?hl=en&lr=&q=free+%22Borland+C%2B%2B%22&btnG=Search).
Forum: C++ Jan 12th, 2007
Replies: 3
Views: 2,155
Posted By andor
C++ is a programming language and turbo C++ is a compiler.
Forum: C++ Jan 11th, 2007
Replies: 4
Views: 1,196
Posted By andor
gotoxy() (http://faq.cprogramming.com/cgi-bin/smartfaq.cgi?answer=1044844545&id=1043284392)
Forum: C Jan 11th, 2007
Replies: 20
Views: 4,290
Posted By andor
Check this (http://www.cprogramming.com/tutorial.html). Here you have OpenGL and graphics programming tutorial.
Forum: C++ Jan 11th, 2007
Replies: 4
Views: 1,196
Posted By andor
Well the best is to avoid non standard functions so you will not have this type of problems. For clrscr() read this (http://faq.cprogramming.com/cgi-bin/smartfaq.cgi?answer=1031963460&id=1043284385).
Forum: Assembly Dec 11th, 2006
Replies: 2
Views: 5,169
Posted By andor
With which part do you have problem?
Forum: C Dec 7th, 2006
Replies: 4
Views: 1,148
Posted By andor
Segmentation fault (http://en.wikipedia.org/wiki/Segmentation_fault)
Forum: C Dec 5th, 2006
Replies: 3
Code Snippet: Alpha blend algorithm
Views: 9,480
Posted By andor
rb stands for red and blue. To get this component we must mask with 0x00ff00ff. Why?
Becouse the first 8 MSB bits are the alpha transparent component, next byte (or 8 bits) is the red component...
Forum: C++ Dec 1st, 2006
Replies: 9
Views: 2,141
Posted By andor
Create a thread which will have only getchar. If something pressed then set a bool value in that thread. Of course in while loop will break when the bool value is set.
Forum: C++ Nov 30th, 2006
Replies: 1
Views: 1,007
Posted By andor
Read this (http://www.codeproject.com/cpp/PtrToPtr.asp)
Forum: C Nov 29th, 2006
Replies: 7
Views: 1,825
Posted By andor
Try something like this after the loop:

printf("current position = %d\n", curr = ftell(file));
fseek(file, SEEK_END, 1); /* go to end of file */
printf("last position = %d\n", last =...
Forum: C++ Nov 29th, 2006
Replies: 4
Views: 1,555
Posted By andor
Use function like int strncmp(const char *str1, const char *str2, size_t n); (http://www.acm.uiuc.edu/webmonkeys/book/c_guide/2.14.html#strncmp)
Forum: C Nov 29th, 2006
Replies: 7
Views: 1,825
Posted By andor
First of all you open the file in binary mode:

input = fopen(argv[3], "rb");
output = fopen(argv[4], "wb");

and then using fwrite function.
Forum: C Nov 29th, 2006
Replies: 9
Views: 10,090
Posted By andor
you mean something like this

sizeof(array)/sizeof(type of array);
Forum: C Nov 22nd, 2006
Replies: 9
Views: 1,660
Posted By andor
#include <stdio.h>
#include <string.h>

int one_less(char *);
int main()
{
char s[20];
printf("Type string\n");
scanf("%s", s);
printf("number of changes made is...
Forum: C Nov 21st, 2006
Replies: 9
Views: 1,660
Posted By andor
With something like this:

if ((a[i] > '0') && (a[i] <='9'))
{
a[i] -= 1;
}

In the loop.
One remark about your code. You are not obtaining the string the right way. Read this...
Forum: C Nov 21st, 2006
Replies: 7
Views: 1,174
Posted By andor
No one will help you without a try. This kind of program is posted several times on this forum so you can try to search it.
Forum: C Nov 14th, 2006
Replies: 4
Views: 1,367
Posted By andor
Use counter which will print the chars.

for(i=0; i<totalLengthOfString; i++)
{
if(i != 0 && i % MAXIM == 0)
{
putchar('\n');
}
putchar(string[i]);
}
Forum: C++ Nov 13th, 2006
Replies: 2
Views: 1,874
Posted By andor
Did you serched at google?
Forum: C Nov 13th, 2006
Replies: 11
Views: 3,347
Posted By andor
You cant do this

foo(someParam, "my age is %d", age)

becouse the compiler thinks the function takes 3 parametars but at his definition it takes two.
Forum: C++ Nov 13th, 2006
Replies: 3
Views: 1,204
Posted By andor
Whats the question?
Forum: C Nov 8th, 2006
Replies: 3
Views: 2,248
Posted By andor
Do you have memory allocation check? Implement it then you will be shore is that your problem or not.
Forum: C++ Nov 7th, 2006
Replies: 4
Views: 2,216
Posted By andor
Sorry didn't understood your post
Forum: C++ Nov 7th, 2006
Replies: 4
Views: 2,216
Posted By andor
Forum: C Nov 7th, 2006
Replies: 10
Views: 3,390
Posted By andor
Hm read the first post

Whats the posibility that the string have more than 25 chars?

#include <stdio.h>

int main()
{
char p[25] = "STEPHEN JOHNSON - LTD";
char *string = p;
Forum: C Nov 7th, 2006
Replies: 10
Views: 3,390
Posted By andor
First form your string like "STEPHEN JOHNSON".

for (i=0; i<25; i++, string++)
{
if (*string == '-' && i != 0)
{
*(string-1) = '\0';

}
}
Forum: C Nov 7th, 2006
Replies: 10
Views: 3,390
Posted By andor
If other strings are similar remove everything after the second space.
Forum: C Nov 3rd, 2006
Replies: 5
Views: 1,402
Posted By andor
Forum: C++ Nov 3rd, 2006
Replies: 3
Views: 2,444
Posted By andor
You made a little mistake with your link. No big deal just test it and U will understand :)
Forum: C Nov 3rd, 2006
Replies: 1
Views: 1,107
Posted By andor
Try C# forum
Forum: C Nov 2nd, 2006
Replies: 1
Views: 1,842
Posted By andor
Did you tried with fgets (http://www.acm.uiuc.edu/webmonkeys/book/c_guide/2.12.html#fgets)? For help read this (http://faq.cprogramming.com/cgi-bin/smartfaq.cgi?answer=1046476070&id=1043284351)
Showing results 1 to 40 of 275

 


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

©2003 - 2009 DaniWeb® LLC