Search:

Type: Posts; User: sujeet1

Search: Search took 0.01 seconds.

  1. Replies
    2
    Views
    1,655

    adding extra to char*

    Hi,i was doing c program to read files and manipulate it.

    i got

    char *word="test";


    then, i wanted to add a extra letter at the end? how to do it?any one can tell?

    that means i wanted
  2. Thread: end of file

    by sujeet1
    Replies
    3
    Views
    1,040

    end of file

    I was writing a program to read text in a file and store the words.

    MY inputTextFile was aw.txt


    first line of file
    this is last


    my program to read the file
  3. Replies
    5
    Views
    1,898

    Thanks for helping out.no memory allocation is...

    Thanks for helping out.no memory allocation is the main problem.But I wonder how come the 2nd code worked as it didn't have memory allocation.
  4. Replies
    5
    Views
    1,898

    wierd struct error

    Hi,
    I was reading a text file,and storing each word in a struct:


    typedef struct WordNode{
    struct wordNode *nextWord;
    char *word; //store the word
    int whiteSpaces; //num of spaces between...
  5. Replies
    2
    Views
    1,127

    conver char [] to char*

    hi,
    i got


    char word [80]
    and want to convert it to



    char *word
  6. Replies
    17
    Views
    3,383

    when u say complexity are u refering to the big O...

    when u say complexity are u refering to the big O notation ?
    like O (1) O (n square ) O(n) and stuff>
  7. Thread: wierd error

    by sujeet1
    Replies
    2
    Views
    811

    wierd error

    int main(void){

    int a,b;
    a=3;
    b=3;
    if(b==a==3){
    printf("OK");
    }
    else{
    printf("NOT OK");
  8. Replies
    5
    Views
    1,554

    struct node warning

    #include <stdio.h>

    typedef struct{
    struct name *studentName;
    }student;


    typedef struct{
    char *firstName;
    char *secondName;
  9. Replies
    2
    Views
    1,336

    modifying struct values

    #include <stdio.h>


    typedef struct{
    int size;
    }FileADT;

    void setSize(FileADT *file){
    file->size=100;
    printf("1->%d",file->size);/*prints the file size correctly*/
  10. Replies
    5
    Views
    1,349

    but how do i erase the data in the data file? ...

    but how do i erase the data in the data file?

    waht command?
  11. Replies
    5
    Views
    1,349

    editing data in a data file

    hi..is it possible clear data in a .dat file.

    lets say my file initially has:

    *******
    my name is sujeet.
    *******

    Now i want to clear all that data and have my file data:
  12. Replies
    4
    Views
    1,329

    finding end of array

    thanx for the reply.

    now if i want to output all the data of the list i would do this ?



    while(numList!=0){
    cout<<*numList;
    numList++'
    }
  13. Replies
    4
    Views
    1,329

    pre defined arrays

    hi..i wanted to do something like this:



    int size;
    cin>>size;

    int numList[size];
  14. Replies
    4
    Views
    1,493

    compare if 2 string types are equal

    hi,i got 2 variables of string format.how to compare if they are equal????



    string a="Asd";
    string b="Asd";
    if(strcmp(a,b)==0){
    cout<<"true";
    }
  15. Replies
    1
    Views
    1,786

    stl vector + iterator operation

    I wrote a simple 'base' class and I then had a vector of 'base' objects.I then created 10 base objects.I then wanted to ouput the contents of it using a iterator.How do i do it? i get error.


    ...
  16. Replies
    2
    Views
    1,785

    write data to end of file

    hi..i want to write data to a file. i want to write the data at a specific position in the file.

    curently i want to write to end of file. how do i scroll to end of file and write the data there?
    ...
  17. Replies
    3
    Views
    952

    Dave,Thanx for your reply. WOW,i thought...

    Dave,Thanx for your reply.

    WOW,i thought '#include <string>' is only for string functions/operations.
    I dont see which part of my program does require the string class.
  18. Replies
    3
    Views
    952

    class compiling eror

    #include <iostream>
    using namespace std;

    class base
    {
    public:
    base(string name)
    { a=name;
    cout<<"base."<<a<<endl; //ERROR LINE
    }
  19. Replies
    5
    Views
    3,270

    char array of words

    Hi,I wanted to have a array for char words. That is have a list of words like one two three

    So, tried

    char *num[]={"One","Two","three"};
    And it works fine. But later I wanted...
  20. Replies
    7
    Views
    2,367

    thanx..i got 1 error rectified. but i still got...

    thanx..i got 1 error rectified. but i still got one last wierd error left.



    class CChildClass : public CBaseClass
    {
    public:
    virtual string GetClassMessage()
    {
    return "I am the Child...
  21. Replies
    7
    Views
    2,367

    hey umr student, thanx for your reply.my problem...

    hey umr student, thanx for your reply.my problem does get partly solved by using pointers.



    class patient{
    private:
    public:
    void print(){
    cout<<"\nprint method from patient class ";
    }
  22. Replies
    7
    Views
    2,367

    stl container to store more than 1 type

    Hi i got a design issue here.

    I got


    class patient{
    }

    class dayPatient:public patient{
    }
  23. Replies
    3
    Views
    1,214

    the reason y i took a int was for example. ...

    the reason y i took a int was for example.



    for int we would have:

    int sujeet;
    sujeet=100;

    so can we do like ....
  24. Replies
    3
    Views
    1,214

    assigning values to constructor

    hi,i was writing a hospital program to manage 3 types of patients.(outpatient,inpatient,daypatient)

    For example for int variables. we can initially declare it as int a; then do, a=10;
    can the...
Results 1 to 24 of 24