a valid statement??
In my program I have the following statements
void Person::setTitle(const Glib::ustring& str) {
switch ( str ) {
case "None" : {
title = title_t::None;
break;
}
case "Dr" : {
title = title_t::Dr;
break;
}
..
case "Rabbi" :{
title = title_t::Rabbi;
break;
}
case "Shaykh" :{
title = title_t::Shaykh;
break;
}
default : {
title = title_t::None;
break;
}
}// switch
}//Method
when compiling I get an error code that reads:
error: switch quantity not an integer
Which is true, but according to
http://newdata.box.sk/bx/c/htm/ch07.htm#Heading54
the error is unwarranted, since the parameter received by the method
and later on given to the switch statement for scrutiny is a valid C/C+
+ statement [setTitle(const Glib::ustring& str)]
Can anyone shed some light to this problem?
___
help-gplusplus mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/help-gplusplus
what is difference_type?
Does anyone know what is the value of ' _Iterator::difference_type ' as it is stated in: 'std::iterator_traits' i.e. typedef _Iterator::difference_type difference_type. Thanks in advance. ___ help-gplusplus mailing list [email protected] http://lists.gnu.org/mailman/listinfo/help-gplusplus
Re: what is difference_type?
Thanks for your prompt response, that was very helpful. Have a good one. John V Shahid wrote: > It is the type used to represent the difference between two iterators of > the same type. Usually it is ptr_diff for regular c/c++ pointers, since > they are considered random access iterators and there's a specialized > iterator_traits for them(i mean pointers). > > On Thu, 2006-12-14 at 05:58 -0800, [EMAIL PROTECTED] wrote: > > Does anyone know what is the value of ' _Iterator::difference_type ' as > > it is stated in: > > 'std::iterator_traits' i.e. typedef _Iterator::difference_type > > difference_type. > > Thanks in advance. > > > > ___ > > help-gplusplus mailing list > > [email protected] > > http://lists.gnu.org/mailman/listinfo/help-gplusplus > -- > John V. Shahid ___ help-gplusplus mailing list [email protected] http://lists.gnu.org/mailman/listinfo/help-gplusplus
GDB, I know, I know, off topic
Sorry, but I don't know where else to find C++ programmers who, without a doubt, will be able to help me with this problem. I am developing a GUI [GTKMM] under MS Window XP, and since I am not familiar with the development aspect of MSW I am having problems with the GDB. The application has a 'runtime error' or in other words, it has a segmentation fault, to find out which method call caused the segmentation fault [sf], I typed gdb Jaime.exe -> run [the sf occurs] -> bt... then the words " No stack." appear. How can I check which f'tion or method call caused the problem? Thanks folks, and please forgive me for the off topic thing. === PD, here is the Makefile: # Project: Jaime # Makefile created by Dev-C++ 4.9.9.2 CPP = g++.exe -D__DEBUG__ CC = gcc.exe -D__DEBUG__ WINDRES = windres.exe RES = OBJ = main.o ../jme/exception/exception.o jaime.o combo.o contacts.o entry.o $(RES) LINKOBJ = main.o ../jme/exception/exception.o jaime.o combo.o contacts.o entry.o $(RES) LIBS = -L"C:/Dev-Cpp/lib" -user32 -Wl,-luuid -Wl,--rpath -Wl,/home/ivan/cross/build/lib -LC:/Dev-Cpp/lib -L/home/ivan/cross/build/lib -lgtkmm-2.4 -lgdkmm-2.4 -latkmm-1.6 -lgtk-win32-2.0 -lpangomm-1.4 -lglibmm-2.4 -lsigc-2.0 -lgdk-win32-2.0 -limm32 -lshell32 -lole32 -latk-1.0 -lgdk_pixbuf-2.0 -lpangowin32-1.0 -lgdi32 -lpangocairo-1.0 -lcairo -lpangoft2-1.0 -lfontconfig -lfreetype -lz -lpango-1.0 -lm -lgobject-2.0 -lgmodule-2.0 -lglib-2.0 -lintl -liconv -mwindows -lgmon -pg -g3 INCS = -I"C:/Dev-Cpp/include" CXXINCS = -I"C:/Dev-Cpp/lib/gcc/mingw32/3.4.2/include" -I"C:/Dev-Cpp/include/c++/3.4.2/backward" -I"C:/Dev-Cpp/include/c++/3.4.2/mingw32" -I"C:/Dev-Cpp/include/c++/3.4.2" -I"C:/Dev-Cpp/include" BIN = Jaime.exe CXXFLAGS = $(CXXINCS) -mms-bitfields -IC:/Dev-Cpp/include/gtkmm-2.4 -IC:/Dev-Cpp/lib/gtkmm-2.4/include -IC:/Dev-Cpp/include/glibmm-2.4 -IC:/Dev-Cpp/lib/glibmm-2.4/include -IC:/Dev-Cpp/include/gdkmm-2.4 -IC:/Dev-Cpp/lib/gdkmm-2.4/include -IC:/Dev-Cpp/include/pangomm-1.4 -IC:/Dev-Cpp/include/atkmm-1.6 -IC:/Dev-Cpp/include/gtk-2.0 -IC:/Dev-Cpp/include/sigc++-2.0 -IC:/Dev-Cpp/lib/sigc++-2.0/include -IC:/Dev-Cpp/include/glib-2.0 -IC:/Dev-Cpp/lib/glib-2.0/include -IC:/Dev-Cpp/lib/gtk-2.0/include -IC:/Dev-Cpp/include/pango-1.0 -IC:/Dev-Cpp/include/cairo -I/home/ivan/cross/build/include/freetype2 -I/home/ivan/cross/build/include -IC:/Dev-Cpp/include/atk-1.0 -fno-access-control -fexceptions -fverbose-asm -pg -g3 CFLAGS = $(INCS) -fno-access-control -fexceptions -fverbose-asm -pg -g3 RM = rm -f ___ help-gplusplus mailing list [email protected] http://lists.gnu.org/mailman/listinfo/help-gplusplus
The value returned by the 'Esc' key
In the statement: while((ch = getch) =! ZERO) I would like to change the value ZERO to the value returned by the 'Esc' key, but I don't know how Linux maps the keys on the key words, as you know conio.h has a macro value for each of the function keys as well as other keys. Is there something similar in g++? can you know of a place in the internet that might have any info. about this topic? T.I.A. ___ help-gplusplus mailing list [email protected] http://lists.gnu.org/mailman/listinfo/help-gplusplus
A DataBase
Hi folks! What would be the most common database used in Linux Debian? I have an app that uses MS-Access as its database. The reason I chose Access was because it is the most common Database in the MSWin World. I would like to know if the is one in Linux Debian's Data Base? Thanks folks! ___ help-gplusplus mailing list [email protected] http://lists.gnu.org/mailman/listinfo/help-gplusplus
Passing some values to the parent class
class Base{
private:
int i;
char* c;
public:
Base(const int, const char*);
...
};
class Derive : virtual public Base{
private:
...
public:
Derive(const int x, const char* y){ pass_vars_to_base_class
(x,y);}
...
};
The class above shows something I want to do, to pass some values to
the parent class. Can someone please tell me how to do this?
Thanks folks!
___
help-gplusplus mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/help-gplusplus
A question on 'auto_ptr'
I would like to pass a variable pointer that has been instantiated
using 'auto_ptr' to a class method, however, the compiler complains
saying that it does not recognize the method call; gives me a number
of options, basically the list of overloaded methods. So my question
is, what is the proper way to pass 'auto_ptr('s)' to a method?
class MyClass{
private: std::string str*
public:
MyClass(){ std::auto_ptr str(new
std::string("unknow"));}
MyMethod(const std::string& s){ str = s;} // <== Error??
..
}
main(){
std::string temp*
std::auto_ptr tmp(new std::string("hey!"));}
MyClass mc();
mc.MyMethod(temp); // <<-- Error??
...
}
___
help-gplusplus mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/help-gplusplus
compiling 'make' w/o 'make' (?)
Now that I am trying to install Debian from a CD, I found that the network card was not supported, I read that some dude had found a driver for the NIC in a MSI-M662 laptot, I myself don't know what kind of NIC is in this machine, I am going by what the dude claims. However, after downloading the alleged driver, I had to compile it, for that I need to have 'make', but this machine does not have the make program, after downloading it from the GNU' FTP site, I found out that I also have to build this program using 'make'. As you can see I am in a vicious circle, can anyone help me get out of it. TIA ___ help-gplusplus mailing list [email protected] http://lists.gnu.org/mailman/listinfo/help-gplusplus
