List:MySQL++« Previous MessageNext Message »
From:Warren Young Date:January 25 2009 6:19am
Subject:Re: What is a row? and can i use it as a vector?
View as plain text  
On Jan 24, 2009, at 8:54 PM, pavel989@stripped wrote:

> ??? what i was trying to do, is pass the row[0] value, into a new  
> char array, through a
> for loop, so that itd print the entire value, on different lines  
> through glPrint.
> basically i was thinking that if the title (in this case) is longer  
> than 16, i want to print
> 16 char of the title, move down, and continue.

This is nothing to do with MySQL++.  This is basic text processing  
problem.

 From this and the rest of your message, I get the impression that  
you're just starting to learn about programming.  That's great, but  
this is not the place to get that education.

This might help clear the fog about the connection between MySQL++  
string structures and C strings:

	mysqlpp::sql_text dbstring;
	char ac[10];
	strncpy(ac, dbstring.c_str(), sizeof(ac));
	ac[sizeof(ac) - 1] = '\0';

That will copy dbstring into a null-terminated array of characters --  
a C string -- truncating it to the maximum size of the array, giving  
at most 9 characters.

> now when i tried the for loop way, i was getting errors that the  
> buffer is too small, and I
> think it has something to do with me using "char * " so it was  
> probably just pointer problems.
> But then i figured i should try to use vectors. and now i get "cant  
> convert from char to char*"
> or something like that.

You're not going to get much help for such vague problem descriptions  
as this.  The best you can hope for is commiseration.  If you want a  
solution, show the code and give the exact text of the error you got  
when trying to compile or run it.
Thread
Re: Re: What is a row? and can i use it as a vector?pavel98925 Jan
  • Re: What is a row? and can i use it as a vector?Warren Young25 Jan
Re: What is a row? and can i use it as a vector?pavel98927 Jan