Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Data Conversion

Posted on 1999-07-28
2
Medium Priority
?
262 Views
Last Modified: 2010-04-15
How do I do a data type conversion with C ?

For example:  
At the beginning of my program, I declare
char student;

I would like to convert this to
SQLCHAR student;
once I enter one of my functions

Can anyone tell me how n the coding to do this data conversion?

Thanks...
0
Comment
Question by:pearl1
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 3

Expert Comment

by:marcjb
ID: 1264008
What is SQLCHAR?  Is it a structure?  Is it just a typedef for char?
0
 
LVL 3

Accepted Solution

by:
arnond earned 150 total points
ID: 1264009
if you need to use this variable just a few times, you can use casting.
something like this:
-------------------------
char student1;
SQLCHAR student2;

student1 = (SQLCHAR) student1;
----------------------------

but, if you want to use this vaiable constantly as SQLCHAR, you need to declare a new variable and assign it the value of the old variable like in my example (of course, yo cann't have them both with the same name)


Hope this helps,
Arnon David.

0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Have you thought about creating an iPhone application (app), but didn't even know where to get started? Here's how: ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ Important pre-programming comments: I’ve never tri…
This tutorial is posted by Aaron Wojnowski, administrator at SDKExpert.net.  To view more iPhone tutorials, visit www.sdkexpert.net. This is a very simple tutorial on finding the user's current location easily. In this tutorial, you will learn ho…
Video by: Grant
The goal of this video is to provide viewers with basic examples to understand and use nested-loops in the C programming language.
The goal of this video is to provide viewers with basic examples to understand and use conditional statements in the C programming language.

705 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question