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
Type: Posts; User: sujeet1
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
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
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.
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...
hi,
i got
char word [80]
and want to convert it to
char *word
when u say complexity are u refering to the big O notation ?
like O (1) O (n square ) O(n) and stuff>
int main(void){
int a,b;
a=3;
b=3;
if(b==a==3){
printf("OK");
}
else{
printf("NOT OK");
#include <stdio.h>
typedef struct{
struct name *studentName;
}student;
typedef struct{
char *firstName;
char *secondName;
#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*/
but how do i erase the data in the data file?
waht command?
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:
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++'
}
hi..i wanted to do something like this:
int size;
cin>>size;
int numList[size];
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";
}
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.
...
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?
...
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.
#include <iostream>
using namespace std;
class base
{
public:
base(string name)
{ a=name;
cout<<"base."<<a<<endl; //ERROR LINE
}
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...
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...
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 ";
}
Hi i got a design issue here.
I got
class patient{
}
class dayPatient:public patient{
}
the reason y i took a int was for example.
for int we would have:
int sujeet;
sujeet=100;
so can we do like ....
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...