174 Topics
|
|
Hi all. I'd like to ask for a way to store a MySQL table content of type VARCHAR to a CHAR variable in C. The MySQL table has three columns: ID (int), Name (varchar(22)), Salary (int). My C program should ask the user to input an ID number, and depending … |
|
Ok, so you know how, if we want to output the elements of an array to the screen, we have to make a for loop right? So I have the following code... [CODE] char array[] = new char [10]; array[0] = '1'; array[1] = '2'; . . . . array[9] … |
|
Hello! I've got a little problem... I want to make a program which puts 10 random character, but the characters should NOT be digits. [CODE]#include <ctime> #include <stdio> #include <iostream> using namespace std; int main() { time_t t; time(&t); srand(t); int i,c; char ch; printf("Generating 10 random characters...\n"); for(i=1;i<=10;i++) { … |
|
Hi, I have a jsp page running under jboss 4.2.2 server. The structure for the page is like : include head ( head is written on another page, like masterpage in aspx. ) <body> ( codded in main page ) include foot ( foot is also written in another page. … |
|
I am trying to use an exported function from a C++ dll with the below signature, from within my C# program. [CODE=C]extern "C" __declspec(dllexport) BOOL S_USB_Memsize(unsigned char *buffer)[/CODE] In my C# code , I am declaring the use of this function with: [CODE=C][DllImport("RSTUSBIF.dll",CallingConvention = CallingConvention.Cdecl)] public static extern int S_USB_Memsize(IntPtr … |
|
Working with large int numbers. Broken up as char for each digit, total of 3 arrays, n1, n2, and sum. I have everything completed, the math works fine, the arrays work fine, the shuffling to the right side of the array works fine. I just have two issues, that both … |
|
The question is: A file contains a list of names in the form: Jones, Frederick M Brennan, Claire Your program should alphabetize the list. Use the C++ string class. Also, extract names from the input stream with getline(). What i know so far: main() should declare a char array and … |
|
My professor has working with very large number. We bring them into our project through a file stream (.txt). I get the MATH behind using 3 arrays to add, subtract, and store the sum of the numbers. I get that you can do a "x-'0'" to convert the char to … |
|
So I've been working on a program that takes a string and then puts it in an i * 6 char array but I can't seem to get it to work, any help with the problem would be much appreciated. Here is the unsatisfactory code I have so far: [CODE] … |
|
Im doing a code "test" from the c++ book I am currently reading, the objective is to ask for input using a function and output data using a function, while keeping the data in main. I finished it and it works, but I want to make the program not accept … |
|
Hye everyone, I am trying to make a 2d-char array, fill it with random letters(chars) and print it. If I do it like this I get a ArrayIndexOutOfBoundsException: 0. I am a newbee. I import my prefs(width, height) from static getters in the class preferences. Can anyone help me please? … |
|
Hi, I'm in my first Java class and I am working on a problem that I could solve if I just figure out how to convert a char to an int. i.e. convert A to its letter equivalent with a function like this: [CODE] intLetter = charLetter.parseInt(); [/CODE] am I … |
|
I am building a text only hangman game and I have gotten it to the final stages as far as I know I only have one problem I can't figure out why my char comparison values are always returning false even though I know that the characters are the same. … |
|
Hi there, it's me again. My last post isn't even solved yet but already i'm on a new job, of which i'm not very proud. This time i need to convert the hex codes i put in a textbox as a string like this: "55 00 01 61 07 46" … |
|
Hello all, I am enrolled in an intro to C++ class, and I need some help on our final program. Any suggestions are greatly appreciated, as I am quite new to this please don't criticize. Our program requirements require us to receive a command (I.E. delete) input as an array … |
|
Hello. I have a problem with one part of my homework. I'm not exactly sure how to say this in English. I want the constructor to build an object and assign string values to attribute1 and attribute2. I'm only posting the relevant part of my code. My class can be … |
|
Hi guys, I would like to add a char to the end of a char* So imagine the following: char* test = "ABC" I want to add D to the end of it to get test == "ABCD" for the sake of argument, I can not use strcat as I … |
|
I have a file with a list of names. Jane Huston Bob Brown Jack Tracy they should be ordered by last line like this Bob Brown Jane Huston Jack Tracy but my program wont compile and i dont know how to fix it? here is my code #include <iostream> #include … |
|
I was trying to get this work, but couldn't find a way to work this out. I'm new to vb.net. In a text box, the user enters a number for example a 9 digit number. I want the user enter to enter a 9 digit number that is starting from … |
|
Hi I am trying to write a program that asks the user for a 2 digit number and then takes that number and prints out its english name. ex: 45 Forty - Five The problem I am having at the moment is that I cant figure out how to seperate … |
|
Well, in this program I want it to take in a string or character array I really don't care which, for this instance I wouldn't know which is better. Afterwords, it compares those in if statements and sets a variable to a 1(female) or 2(male). Anyways, here is what I … |
|
I have a case where I am not allowed to use the string class so I am using a char array. Does anyone have any idea why I am getting all the junk characters after my char array when i print? The input file is a 2 line file containing … |
|
Hi! Having some problems with functions in this one. As ypu can see I'm a tottal beginner. What I'm trying to do here is make a program checking if a word is a palindrome. Using 2 functions, one to check and one to reverse the user input string. My problem … |
|
So, first off lemme explain what a substitution code is in case you don't know. In cryptography, it's a system by which one letter is replaced with another predetermined letter. For example, if "I" turns to "E", and "F" turns to "V", the word "If" would be written as "Ev". … |
|
i have declared [CODE] char arr[10][10]; [/CODE] and did this: [CODE] for(i=1;i<=n;i++){ arr[i] = (char)i; } [/CODE] but it wouldn't work.. i want to put the number inside the array.. y does this error? |
|
Hello everyone. I am trying to copy data from a file stream into a char*. I know there are ways to do it with std::string and getline, but I have an assignment where I have to have a class that will take a char* into one of its constructors (which … |
|
I need to pass part of a string to function: [CODE] string original_string="my_name_original"; string wanted_string (original_string,7); //take "my_name" only my_func(wanted_string, other_var); //func: void my_func(string wanted_string, int other_var); [/CODE] This doesn't seem to work, the compiling was OK but the passed "wanted_string" is empty; When pass char*, it works fine: [CODE] … |
|
Hi, I am kind of new to C++ and really stuck with a problem. Here I am trying to parse a string and after comparing to a pre-declared array save the tokens in a vector of vectors. It is giving a number of errors and I'm not sure what to … |
|
MY question is, like we do for integer and float, Integer.parseInt(args[0]) Float.parseFloat(args[1]) How do we take character input from command line ? |
|
hi, well i have posted this on two other forums without success, hoprfuly you guys can help me ! the scenario - i have a native c++ dll that creates and initializes a string, which is a char array. [CODE] char pRet[1024]; memset(pRet, 0, 1024); strcpy(pRet, "change me!"); [/CODE] the … |
The End.