473,396 Members | 2,089 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

compile problem

JC
when i compile my c program which use to link to a access database via ODBC

i got two warning message when i compile the c program
odbctest.c(37) : warning C4761: integral size mismatch in argument;
conversion supplied
odbctest.c(38) : warning C4761: integral size mismatch in argument;
conversion supplied

my coding are like the following
....
HSTMT hstmt;
int no;
char* szModel[128];
SDWORD cbMobel;
......
line 37: SQLBindCol(hStme, no, SQL_C_CHAR, szModel,
sizeof(szModel),&cbModel);

can anyone give me a idea? what problem on my coding.. and how to fix the
warning message.

thanks

JC
Nov 13 '05 #1
3 6722
"JC" <jc@jc.com> wrote:
odbctest.c(37) : warning C4761: integral size mismatch in argument;
conversion supplied
odbctest.c(38) : warning C4761: integral size mismatch in argument;
conversion supplied HSTMT hstmt;
int no;
char* szModel[128];
SDWORD cbMobel;
.....
line 37: SQLBindCol(hStme, no, SQL_C_CHAR, szModel,
sizeof(szModel),&cbModel);


I suppose line 38 is similar?

One of the arguments to SQLBindCol is of the wrong size. Since we don't
know how SQLBindCol is declared, we don't know which, but a comparison
between what that function expects and what you are actually passing it
should expose the problem.

Richard

Nov 13 '05 #2
JC wrote:
when i compile my c program which use to link to a access database via
ODBC

i got two warning message when i compile the c program
odbctest.c(37) : warning C4761: integral size mismatch in argument;
conversion supplied
odbctest.c(38) : warning C4761: integral size mismatch in argument;
conversion supplied

my coding are like the following
...
HSTMT hstmt;
int no;
char* szModel[128];
SDWORD cbMobel;
.....
line 37: SQLBindCol(hStme, no, SQL_C_CHAR, szModel,
sizeof(szModel),&cbModel);

can anyone give me a idea? what problem on my coding.. and how to fix the
warning message.

thanks

JC

Wrong assumptions about sizeof() could do this. Did you
#include <stdlib.h>
?
--
Tim Prince
Nov 13 '05 #3
On Thu, 25 Sep 2003 16:17:38 +0800, in comp.lang.c , "JC" <jc@jc.com>
wrote:
char* szModel[128];
so szModel is an array of 128 pointers to char.
line 37: SQLBindCol(hStme, no, SQL_C_CHAR, szModel,
sizeof(szModel),&cbModel);
At a guess, the 4th parameter of SQLBindCol expects something
different to an array of pointers. Most probably it expects a pointer
to an array...
can anyone give me a idea? what problem on my coding.. and how to fix the
warning message.


pass the right type. Pointers are not the same as arrays, and arrays
of pointers are not the same as pointers to arrays. .

--
Mark McIntyre
CLC FAQ <http://www.eskimo.com/~scs/C-faq/top.html>
CLC readme: <http://www.angelfire.com/ms3/bchambless0/welcome_to_clc.html>
Nov 13 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
by: janeaustine50 | last post by:
Python's InteractiveInterpreter uses the built-in compile function. According to the ref. manual, it doesn't seem to concern about the encoding of the source string. When I hand in an unicode...
5
by: Carmine Cairo | last post by:
Hi, I'm working on a project and today I've note a little problem during the compile fase. Here a little piece of code: // 1st version welldone = 0; size = p->getSize(); backbone = new...
5
by: Brice Prunier | last post by:
Here under 4 schemas i'm working with ( it may be long: sorry...) The context is the following : Resident.xsd imports Person.xsd and includes Common.xsd ( anonimous schema: no TargetNamespace )...
10
by: Jean-David Beyer | last post by:
I have some programs running on Red Hat Linux 7.3 working with IBM DB2 V6.1 (with all the FixPacks) on my old machine. I have just installed IBM DB2 V8.1 on this (new) machine running Red Hat...
9
by: serge | last post by:
I have a stored procedure that is over 1000 + lines of code. When i try to compile I get the following error: ABC.TEST123: 1285: SQL0104N An unexpected token "END" was found following " END...
10
by: Bart Goeman | last post by:
Hi, I have a question about how to put redundant information in data structures, initialized at compile time. This is often necessary for performance reasons and can't be done at run time (data...
10
by: Chris LaJoie | last post by:
Our company has been developing a program in C# for some time now, and we haven't had any problems with it, but just last night something cropped up that has me, and everyone else, stumped. I...
6
by: Thomas Connolly | last post by:
I have 2 pages referencing the same codebehind file in my project. Originally the pages referenced separate code behind files. Once I changed the reference to the same file, everything worked...
6
by: Tom | last post by:
I am developing my pages on my development machine and then copying to the production server. I am not pre-compiling, I am using the 'dynamic compile' feature. This is working fine except that...
0
by: Jérôme Le Bougeant | last post by:
Hello (and sorry for my English), I downloaded the VideoCapture module on the http://videocapture.sourceforge.net/ site. I tested it with a webcam and that functions. Now I want to...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.