Search Results

Showing results 1 to 40 of 172
Search took 0.02 seconds.
Search: Posts Made By: andor ; Forum: C and child forums
Forum: C May 9th, 2007
Replies: 14
Views: 2,644
Posted By andor
Forum: C May 9th, 2007
Replies: 6
Views: 4,935
Posted By andor
There is no standard way to do that
Forum: C Apr 13th, 2007
Replies: 4
Views: 1,850
Posted By andor
link (http://c-faq.com/expr/ieqiplusplus.html)
Forum: C Feb 9th, 2007
Replies: 3
Solved: C file stream
Views: 5,598
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: 917
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 11th, 2007
Replies: 20
Views: 4,408
Posted By andor
Check this (http://www.cprogramming.com/tutorial.html). Here you have OpenGL and graphics programming tutorial.
Forum: C Dec 7th, 2006
Replies: 4
Views: 1,158
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,890
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 Nov 29th, 2006
Replies: 7
Views: 1,856
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: 7
Views: 1,856
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: 11,165
Posted By andor
you mean something like this

sizeof(array)/sizeof(type of array);
Forum: C Nov 22nd, 2006
Replies: 9
Views: 1,681
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,681
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,190
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,417
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: 11
Views: 3,476
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 8th, 2006
Replies: 3
Views: 2,321
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: 10
Views: 3,525
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,525
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,525
Posted By andor
If other strings are similar remove everything after the second space.
Forum: C Nov 3rd, 2006
Replies: 5
Views: 1,419
Posted By andor
Forum: C Nov 3rd, 2006
Replies: 1
Views: 1,132
Posted By andor
Try C# forum
Forum: C Nov 2nd, 2006
Replies: 1
Views: 1,927
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)
Forum: C Nov 2nd, 2006
Replies: 2
Views: 1,103
Posted By andor
hndl = fopen("file.txt", "r+");
fseek(hndl, 0, SEEK_END);

fprintf(hndl, "some text");

fclose(hndl);
Forum: C Oct 31st, 2006
Replies: 2
Views: 900
Posted By andor
If you want help you must to fix your code. i is undefined and uninitialised. There are more problems with your code but first fix and beautify it.
Forum: C Oct 31st, 2006
Replies: 2
Views: 6,640
Posted By andor
Use code tags, please read this (http://www.daniweb.com/techtalkforums/announcement8-3.html)
Forum: C Oct 31st, 2006
Replies: 2
Views: 1,724
Posted By andor
sizeof(int*) and sizeof(int**) will be the same and it is the size of pointer. sizeof(int) is the size of int .
Forum: C Oct 31st, 2006
Replies: 3
Views: 1,086
Posted By andor
int iNum;
double dNum = 3.61;
iNum = (int) dNum;
Forum: C Oct 30th, 2006
Replies: 16
Views: 3,315
Posted By andor
Forum: C Oct 27th, 2006
Replies: 2
Views: 3,574
Posted By andor
Variable answer is float not int. Instead of printf("%d",answer); use printf("%f",answer); instead. Dont use nonstandard func (use them only if your teacher explicitly demanded). You need a getchar...
Forum: C Oct 26th, 2006
Replies: 5
Views: 1,381
Posted By andor
use int main instead of void main.
Forum: C Oct 25th, 2006
Replies: 12
Solved: Gone Loopy in C
Views: 1,980
Posted By andor
Ok while U're here just to report that the posts order are different for internet explorer and for firefox.
EDIT: is that a bug?
Forum: C Oct 25th, 2006
Replies: 12
Solved: Gone Loopy in C
Views: 1,980
Posted By andor
WHAT!?!? Okay use this

int main()
{
/* your code going here */
return 0;
}
Forum: C Oct 25th, 2006
Replies: 12
Solved: Gone Loopy in C
Views: 1,980
Posted By andor
Ah nice didn't know that it exist ([code=c]). :sad:
Forum: C Oct 25th, 2006
Replies: 12
Solved: Gone Loopy in C
Views: 1,980
Posted By andor
Um you need a main func. Where did you declared the age variable?

do
{
/* stuff */
} while(/*your code going here */);

This is a do while loop, not

do
Forum: C Oct 25th, 2006
Replies: 12
Solved: Gone Loopy in C
Views: 1,980
Posted By andor
Did you copile this? Use [ CODE] [ /CODE] tags.
Forum: C Oct 25th, 2006
Replies: 6
Views: 1,598
Posted By andor
Also you can do it with string.

len = sprintf(buff, "%d", num);

for (i=0; i<len; i++)
{
printf("%d\n", buff[i] - '0');
}

Where num is in your case 1567.
Forum: C Oct 24th, 2006
Replies: 8
Views: 1,859
Posted By andor
When I post something to this thread its not there. Whats happening here.
FOR tiriamwe: Ok fix the code becouse it wont compile. Read this...
Forum: C Oct 24th, 2006
Replies: 8
Views: 1,859
Posted By andor
Wont compile. Fix the errors and read this (http://www.daniweb.com/techtalkforums/announcement8-3.html)
Forum: C Oct 24th, 2006
Replies: 2
Views: 1,000
Posted By andor
Read this (http://www.daniweb.com/techtalkforums/announcement8-3.html)
Showing results 1 to 40 of 172

 


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

©2003 - 2009 DaniWeb® LLC