So I have a class similar to this:
class Something : public vector<putData*>
{
iterator pos;
public:
Type: Posts; User: plot
So I have a class similar to this:
class Something : public vector<putData*>
{
iterator pos;
public:
I need to override an operator = to call a function but I dont know how to do this. Here is a sample of my problem:
class Food
{
insertFood(Fruit f)
{
//Inserts the fruit
}
Thank you that seemed to have fixed the issue I was having.
I did that but it will only print one line I dont know why it would not print other lines in the input file which are formated the same way.
here is what I did:
char temp[500];
char grade;
int...
So I need to read a file that has this input and need to delete the cama and semicolen in the string but idk how to ignore the cama and semicolon:
ex of input file:
A firstname, lastname; 13
...
Never mind I fixed it
Here is my code that I wrote that is suppose to print a tree row by row but is not working and not print the right info.
I pased the root of the tree.
BST_BFS(tree->root);
//data:
Okay so I just changed everything to a single link list just to make it easier to add in doubly linked list (so I hope), this code should also sort data:
#include <stdio.h>
#include...
I have been bashing my head for two hours trying to figure out how to insert a node and print it out. I am not sure if I am doing this correctly or if I am missing anything. It seems that the head...
Okay so I solved it by doing this:
#include<stdio.h>
#include<stdlib.h>
#include<string.h>
int **test();
void printData(int**);
Okay I see what you are trying to say now. But how would you do this to array pointers in pointer notations?
U is a pointer to y.x
Thats what I did? If you take out the typedef struct and declare X as a variable in main (int **x) and is using X it works. But with typedef it wont work like that and not sure why. It is however...
I am haivng problms with passing my values through functions. Can someone help find my problem or provide a solution.
Here is my code:
#include<stdio.h>
#include<stdlib.h>...
I checked if the value of size is getting passed to other functions and yes, using the same sample output i get the length of theString = 7(in the function), size = 86
Both seem correct but length...
I need to use reaalloc to extend the memory when it goes out of bounds but I am not getting a correct output.
this is how i am trying to realloc
if(strlen(theString) - strlen(searchFor) +...
I kind of fixed the issue buy deleting all that and using one for loop.
Sorry that I did not provide the full code, this was a small portion of my program and did not want to put it all here.
...
this is what I have:
for(i = (loc - theString); i < strlen(theString); i++)
{
for(j = 0; j < strlen(searchFor); j++)
{
printf("\nthe start:%c\n", *(theString + i));
if((counter) <...
I am having this problem were the user types in a substring to search in the main string and replace it with another string
for example:
string: hello
sub string: el
replace: i
should...