so I have
class A{
public:
draw(){
cout<<"hello";
}
Type: Posts; User: byebyebyezzz
so I have
class A{
public:
draw(){
cout<<"hello";
}
nvm. I got it fixed.
the problem was somewhere else .
MNode::MNode(CMenuItem* item,unsigned int index, MNode* prev, MNode* next ){
_next = next;
_prev = prev;
_item = item;
_index = index;
}
CMenu& CMenu::add(const char* Text, bool selected){...
I fixed the porblem. (the problem was with my team member's code)
It's working fine now.
Thanks all
I think my syntax is correct.
The problem probably lie on what actually inside data ><.
this is what I have to do
create :
operator char*();
Overload the char* cast to return the value of _Label.data()
_Label.data() return a void* type.
so what I did was
data is void* type
I have
void* classname::data(){ //this function works fine
return data;
}
classname::operator char*(){ //this one cause the program to crash
return (char*)(data());
well this what I did and it worked
char s[2]
s[0] = c[0];
s[1] = '\0';
I wouldnt come up with that w/o you
thanks
could you tell me more on how can I prepend '(' to a null terminated string?
thanks :)
The display function isnt that simple. There are other parameters that I didnt mention here.
I need to use that display function to display something like
(hello world)
where...
well I wish it could be done that easily.
This is a part of my assignment.
The display function is already in used to print a null terminated string.
I cant modify the display function.
I cant...
oh it continues with the code I have in the 1st post.
char c[6]={"hello"};
Thx it works but it doesnt at the same time.
I have this
display(const char *str){
cout <<str;}
at first, I couldnt pass c[0] or c[1] because they are const char so I thought it would...
char c[6]={"hello"};
void* data;
data=c;
Is there any way I can get c[4] or c[3] by using data?
I tried cout<< (char*)data[4]; but it doesnt work.
I am getting this error:
IntelliSense: no default constructor exists for class "A"
I am getting this error because I dont have an empty constructor for class A?
Maybe I typed something wrong in my code but that what I did initially but I have an error. Now I retyped it, it works lol
Thanks.
I have
class A{
...
A(int x,int y){
}
...
}
thank you
#include "dot.h"
namespace dot {
const char* leader(char* s){
for (int i=0;i<ML;i++)
s[i]=".";
s[ML]="\0";
return s;
}
}
thank you!
Hi everyone,
Can someone tell me how can I pass conditional values to a base constructor?
let say I have
class Base{
Base(int a, int b, int c){
switch(c)
case 'a':
cout <<"hello";
case 'b':
cout << "hello";
I have this function
str[10]="ABCDEFGHJI";
int strOffset;
display(str+strOffset);
I just want to know what happen if strOffset is greater than 10. What will be pass to the display...
thank you