5 Archived Topics

Remove Filter
Member Avatar for smithss

[code=c++]int** a = new int*[col]; // works int** b = new int[][col]; //error cannot convert from 'int (*)[1]' to 'int ** int* c[] = new int[][col]; /error cannot convert from 'int (*)[1]' to 'int *[]' [/code] The first one works, but i get these errors when i use the other …

Member Avatar for VernonDozier
1
139
Member Avatar for smithss

Hi Guys, i wrote a program that starts another thread. In one case i thought that i have introduced a memory leak and i should get a segmentation fault but i didn't !! That's kind of puzzled me so i decided to post it here. [code=c++] #include <iostream> #include <windows.h> …

Member Avatar for Salem
0
147
Member Avatar for smithss

Hi Guys... I have some basic doubts with references and pointers and need some understanding on the behavior of this code [code=c++] #include <iostream> using namespace std; class a { public: int getAmount(a&); private: int amount; }; int a::getAmount(a& p) { cout << this << endl; cout << p << …

Member Avatar for smithss
0
91
Member Avatar for smithss

Hi, so i wrote a few of the programs on my own after all the help previosuly but i've got stuck in this one here. The point is the make the string alteast 'n' characters long by padding spaces to its right. [code=c++] #include <iostream> using namespace std; void padRight(char …

Member Avatar for smithss
0
139
Member Avatar for smithss

Hi i have written a standard library function 'strcat' on my own, even though the output seems ok, can someone please verify if what i'm doing is right? i get confused using pointers. [code] void mystrcat(char *a,char *b) { while (*a++ != '\0'); *a--; while (*a++ = *b++); } [/code] …

Member Avatar for smithss
0
115

The End.