Search:

Type: Posts; User: mrbains

Page 1 of 2 1 2

Search: Search took 0.01 seconds.

  1. Thread: about enum

    by mrbains
    Replies
    5
    Views
    1,178

    you can simly compare an int type with a,b,c,d...

    you can simly compare an int type with a,b,c,d etc.
    i.e if(a==6) etc.

    again if want an array of size b you can do
    type array[b];
  2. Replies
    1
    Views
    881

    help with simple OpenGL

    Hi iam new to openGL an i want to know how to print vertex using openGL in a 2d plane.
    suppose i want to print p(2,5),q(3,2) etc on the 2d plane.
    all in know that there is a function for printing...
  3. Replies
    1
    Views
    1,289

    help with simple OpenGL

    Hi iam new to openGL an i want to know how to print vertex using openGL in a 2d plane.
    suppose i want to print p(2,5),q(3,2) etc on the 2d plane.
    all in know that there is a function for printing...
  4. Replies
    2
    Views
    960

    Problem with fgets

    here is my code..



    #include<stdio.h>
    #include<stdlib.h>
    #include<string.h>
    void ssearch(char a[],char b[]);

    main(int argc,char**argv)
  5. Replies
    1
    Views
    2,519

    postfix calculator

    i am trying a postfis calculator so far i wrote



    #include<stdio.h>
    #include<string.h>

    int st[15],top=0;
    void push(int);
    int pop(void);
  6. Replies
    6
    Views
    7,224

    reading a tab delimited file.

    i want to read a tab delimited file for eg. the format is

    item1 value
    item2 value
    item3 value
    item4 value

    etc.
    i want to store each coloumn in an aaray but i can only do this...
  7. Replies
    10
    Views
    2,151

    LOL:D it's not mrbrains it's mrbains.

    LOL:D it's not mrbrains it's mrbains.
  8. Replies
    10
    Views
    2,151

    Well did u try to debug it urself because you...

    Well did u try to debug it urself
    because you missed a lot of ; (semicolons), and few wrong declaration
    here's your code in correct form.
    I only mean no syntax error rest u have done well , so...
  9. Replies
    3
    Views
    1,841

    Try writing getchar(); just before starting while...

    Try writing getchar(); just before starting while loop
  10. Replies
    5
    Views
    4,188

    Thanks for the knowledge so i tried to use it...

    Thanks for the knowledge

    so i tried to use it and wrote this code for a dynamic size stack kind of thing...



    #include<stdio.h>

    int *a;
    int top=0;
  11. Replies
    6
    Views
    6,293

    you can take a 2d array and then store lines...

    you can take a 2d array and then store lines rowwise in that array.
  12. Replies
    5
    Views
    4,188

    Use of malloc and realloc

    Hello everyone,
    i am studying dynamic memory allocation in c,which can be done by using malloc calloc and realloc.
    But still i don't understand the concept.
    for eg
    int *p;
    p=(int*)malloc(100);...
  13. Replies
    1
    Views
    2,308

    Your question is not clear. but if, as far i...

    Your question is not clear.

    but if, as far i understood,you want to enter values when ever your if statement is true.
    for eg.


    for(i=0;i<n;i++)
    { if(statement)
    { scanf("%c",a[i]);
  14. Thread: Search words

    by mrbains
    Replies
    17
    Views
    2,383

    I wrote this to find word freq using strstr(). i...

    I wrote this to find word freq using strstr().
    i modified your code hope u don't mind;)


    /*Program to find word frequency using strstr()*/


    #include<stdio.h>
    #include<string.h>
    main()
  15. Thread: Search words

    by mrbains
    Replies
    17
    Views
    2,383

    i already did solved the problem using...

    i already did solved the problem using arrays(with a lilttle help from here).
    so i guess breaking words using strtok() bad idea??

    thank you Adak for the //printing the unique words logic.
    Billy...
  16. Replies
    3
    Views
    1,212

    put a getchar(); before starting the for loop to...

    put a getchar(); before starting the for loop to clear terminating newline ('\n' or ENTER ) from the input stream
  17. Thread: Search words

    by mrbains
    Replies
    17
    Views
    2,383

    But how do i break a string into words using...

    But how do i break a string into words using strstr().
    the problem is to find freq. of all the words in a string.
    As you said i have to use a copy of all words returned by strtok() how can i do...
  18. Thread: Search words

    by mrbains
    Replies
    17
    Views
    2,383

    to find frequency of a word this works ...

    to find frequency of a word this works



    char a[]="mary had a lamb had";
    char b[]="had"
    char *p=a;

    while(p!=NULL)
    {
  19. Replies
    18
    Views
    2,136

    Well i dont really know on what this depends even...

    Well i dont really know on what this depends even me i was interested to know your processor because i've seen sizeof(int)=4 on amd.
    i am on intel too but my int is 2 bytes.
    so may be it depends on...
  20. Thread: Search words

    by mrbains
    Replies
    17
    Views
    2,383

    commontater did u run your code?? because the...

    commontater did u run your code??

    because the output is HANG.
    is something wrong with my machine??

    iam using turbo c++.
  21. Thread: Search words

    by mrbains
    Replies
    17
    Views
    2,383

    will your code work for the first word as u...

    will your code work for the first word as u wrote???? search will always be the same.
    anyway i've tried using strstr but still as soon as i call strstr(a,pch) it hangs.but if i do strstr(a,b) where...
  22. Replies
    18
    Views
    2,136

    type this code and run it. ...

    type this code and run it.




    #include<stdio.h>

    main()
    {
    printf("size of int =%i",sizeof(int));
  23. Thread: Search words

    by mrbains
    Replies
    17
    Views
    2,383

    i am using strtok to divide words of string and...

    i am using strtok to divide words of string and then calling the function to return frequency.
    i know this can be done in other ways but i want to know why my program is not working.
    yes i dont...
  24. Replies
    18
    Views
    2,136

    sizeof(int)=4 sizeof(char)=1 thats why...

    sizeof(int)=4

    sizeof(char)=1

    thats why your output is 20 with 5 integers.
  25. Thread: Search words

    by mrbains
    Replies
    17
    Views
    2,383

    Search words

    Here is a code i wrote to find the word frequency in a string.


    #include<stdio.h>
    #include<string.h>

    int mystr(char *para,char *word)
    {int count=0;
    if(*word=='\0')
    {return 0;
Results 1 to 25 of 28
Page 1 of 2 1 2