[Solved] i have been on this question for quaring the document for two days straight, and it is not working. don’t want to cheat, can you point the problem

When processing regular characters (final else clause) you read additional input instead of operating over text, i.e. instead of: scanf(“%c”, &document[parano][sentno][wordno][charno]); printf(“%c\n”, document[parano][sentno][wordno][charno]); charno++; you want to do: document[parano][sentno][wordno][charno++] = text[i]; By the time we hit text[i] == ‘ ‘ for the first time the value of ***document is “3\n1 2\n2\n” but you wanted it … Read more

[Solved] i have been on this question for quaring the document for two days straight, and it is not working. don’t want to cheat, can you point the problem

Introduction If you’ve been struggling with a document for two days and can’t seem to get it to work, you’re not alone. Many people have difficulty understanding the complexities of document formatting and troubleshooting. Fortunately, there are many resources available to help you solve your problem. In this post, we’ll discuss some tips and tricks … Read more

[Solved] How to grow a pointer or an array in C at runtime (without knowing the end length at compile time)

OP’s mostly has it. It is just printing the first element each time. // printf(“%d”, *arr); printf(“%d”, arr[n-1]); is it possible to do it with an array? No. In C an array cannot change size once it is defined. The memory size allocated and referenced by a pointer can change though. solved How to grow … Read more

[Solved] Please explain the output of this program based on pointers and strings?

Explanation line by line: Striker=Track; Sets Striker to point to the memory of Track, so Striker[0] would be equals to Track[0]. Track[1]+=30; Increases the value of the second index of Track by 30 (Track[1] = 50). cout<<“Striker >”<<*Striker<<endl; *Striker is the same as Striker[0], *Stirker+1 is the same as Striker[1] and so on. The output … Read more

[Solved] A short C++ program about the pointer

An array of arrays like yours look like this in memory +———+———+———+———+———+———+ | x[0][0] | x[0][1] | x[0][2] | x[1][0] | x[1][1] | x[1][2] | +———+———+———+———+———+———+ The location of x, x[0] and x[0][0] is all the same. Also, arrays naturally decays to pointers to their first element. If you use plain x you will get … Read more

[Solved] Generic class with type as pointer to object of another class – NOT WORKING [closed]

Your code should compile if you: choose one of class/struct in types and one of class/typename in template parameters use semicolons after class or struct definitions write > > instead of >> in nested templates (pre C++11) 5 solved Generic class with type as pointer to object of another class – NOT WORKING [closed]

[Solved] Please solve these errors. I’m using dev++ compiler [closed]

The first error is a typo you wrote pememory. The second error appears because you didn’t code any transformation between Float and ptrFloat. You should add a copy constructor to Float: Float(const Float& a) : Float(*a.fmem_top) {} And then a conversion constructor to ptrFloat: ptrFloat(Float a) : Float(a) { pmem_top=pmemory; *pmem_top=abc; pmem_top++; } PS: your … Read more

[Solved] Using Malloc() to create an integer array using pointer [closed]

It can be inferred from the error message, intarr_create(): null pointer in the structure’s data field, that data fields of each struct are expected to be allocated. intarr_t* intarr_create(size_t len){ intarr_t* ia = malloc(sizeof(intarr_t) * len); size_t i; for(i = 0; i < len; i++) { // ia[len].len = 0; // You can initialise the … Read more

[Solved] Changing vector in function by pointer

The function does not make sense. For starters it is unclear why you are using a pointer to the vector instead of a reference to the vector. Nevertheles, this declaration vector<unsigned char> vec(5); does not reseeve a memory for the vector. It initializes the vector with 5 zero-characters which will be appended with other characters … Read more