Search:

Type: Posts; User: kermitaner

Search: Search took 0.01 seconds.

  1. Replies
    9
    Views
    1,508

    ah, ok, I didn't know that ...

    ah, ok, I didn't know that ...
  2. Replies
    9
    Views
    1,508

    just a few hints: double more[n-1]; //array...

    just a few hints:

    double more[n-1]; //array variable in struct
    doesn't work, because at compile time n doesn't contain a valid value, better use

    double more[10]; //array variable in struct
    ...
  3. Replies
    15
    Views
    3,770

    well, interesting task ;) what is being asked...

    well, interesting task ;)

    what is being asked is clear:
    how to do this ? first u have to read the input file line by line. then u have to process each line char by char and collect chars into a...
  4. Replies
    9
    Views
    2,678

    safe&simple( should work for any non empty string...

    safe&simple( should work for any non empty string :-) :
    #include <stdio.h>
    #include <stdlib.h>

    int main(int argc, char *argv[])
    {
    int count[256]={0},i=0;
    int max=0;
    char maxchar;
    ...
  5. Replies
    8
    Views
    2,117

    well, this is not difficult. take paper and...

    well, this is not difficult.
    take paper and pencil. write down the content of c and pc, after processing one byte after the other from the input string.

    while ((c = getchar()) != EOF) {
    reads...
  6. Replies
    10
    Views
    1,886

    simply processing char by char ;) ...

    simply processing char by char ;)


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

    void parseKeywords(char keyword[3][30]){
    char *orig = "0=up,1=down,2=side*";
    char* kp=NULL;
    int pos=0;
  7. Replies
    2
    Views
    4,442

    hi, u should first work out in our mind ( or...

    hi,

    u should first work out in our mind ( or on paper :p ) how ur program is supposed to work:
    u put ur ships in an 10x10 char array.
    a position that contains a ship is marked with an...
  8. Replies
    17
    Views
    4,849

    hello, the method Adak showed, is of course a...

    hello,

    the method Adak showed, is of course a better solution.
    however for practicing reasons u should try to change the code yourself, first put the reading loop of the second file in the outer...
  9. Replies
    9
    Views
    1,025

    first the (my :) ) solution: i = -1; while (...

    first the (my :) ) solution:

    i = -1;
    while ( ++i < 4 )
    printf( "while: i=%d\n", i );

    the while loop is evaluated at the beginning (head ) .

    i made the while loop start at -1 so the...
  10. Replies
    1
    Views
    2,205

    hm, i didn't know a function for this, so i wrote...

    hm, i didn't know a function for this, so i wrote my own :)

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

    /* converts string of valid hex chars ('XX' : '0'-'9','A'-'F' )
    to 1 byte char array with...
  11. Replies
    17
    Views
    4,849

    #include void pError(char * s){ ...

    #include<stdio.h>
    void pError(char * s){
    printf("%s\n",s);
    system("pause");
    exit(1);
    }

    int main(){

    int det_strings=0;
  12. i get the same output, but its correct. a float...

    i get the same output, but its correct.
    a float in memory has a different structure than an integer.

    the printf("%x",int) means, take the 4 bytes at the ints address and treat them like they...
  13. int i=255; printf("%x\n",i); even gives me 2...

    int i=255;
    printf("%x\n",i);
    even gives me 2 "ff" ;)

    maybe u should try another compiler...
  14. no, printf can do this: printf("%x\n",15);...

    no, printf can do this:

    printf("%x\n",15);
    should give you a nice little "f"
  15. Replies
    15
    Views
    37,278

    there were just 2 errors in the orig. code, 1st...

    there were just 2 errors in the orig. code, 1st the already mentioned summing up in the tmp var, second the obo ( off by one :-) error in the for loop:

    #include <stdio.h>

    int main(int argc,...
Results 1 to 15 of 15