Beginners - May 2011

System::string to char array
 
hi, I have been wondering how to convert a system::string from a form text box into a character array i have, Thanks dave
[4 replies] Last: I use another C language for pic's that require the use of char arrays... (by dmkitsch)
by sebgar
Database question
 
What is the best way (in terms of efficiency and ease) to work with c++ and database? I've been looking around and mysql++ seems pretty neat but I don't have a ...
[3 replies] Last: Just took a quick peek at SQLite site and I think it's just what I was... (by sebgar)
void * unknown size error in C
 
How to fix this error? /* Data structure for Vector */ typedef struct { void* pvElement; /* the pointer to elements */ size_t iSizeElement;/* the size...
[4 replies] Last: What I want to say is that to move x consective elements is a loop lik... (by guestgulkan)
void* assignment error
 
There's an error about the void type. @_@ The first run-time error occurs in the pushBack() (line 20 or 23, I'm not sure) when I try to copy the first value fo...
[2 replies] Last: Line 23 is incorrect. It should be: memcpy(v->pvElement, elem, v->i... (by webJose)
Descriptions of main()
 
Hi everyone, I just joined this forum - I am brand new to C++ and had some questions. I had previously been working a little bit with functions in Python an...
[5 replies] Last: Thanks Comptergeek01! I forgot about Windoze! ;) I said Main usua... (by kooth)
problem with cout
 
Hi guys, I just started learning C++ and I wrote my first program but when I execute it none of my cout statements appear and all I get is a message saying "pre...
[11 replies] Last: when I created the project I clicked on windows application instead of... (by wagnerag)
I seriously dislike QNAN
 
OK, I am trying to write a simple prog to take a couple variables and pass them to four functions and return the results. All I get is QNAN. Here is that...
[3 replies] Last: NAN is an acronym for Not a Number . As Kooth said, your methods ... (by closed account zb0S216C)
Stack Overflow
 
I was trying a problem from the Project Euler site. The problem was: 2520 is the smallest number that can be divided by each of the numbers from 1 to 10 wi...
[10 replies] Last: In my opinion this one is easier to do with a little math knowledge an... (by Browni3141)
loop inside a directory and open files
 
Hi everyone! i'm new to this forum, so I hope I posted my question in the right place! I got a little problem with 'SPRINTF'. My script is: #include <...
[6 replies] Last: wow, is it than simple? I've tried that various times, but it always g... (by zintinos)
Problems with classes & objects
 
Hi, I am trying to learn to use classes and objects, but I'm having some problems. I'm not sure where I'm meant to define the class. Is it before int main () ?...
[3 replies] Last: Thank you very much. Enterprise D (by Enterprise D)
by tonnot
Is it possible to use streambuf directly ?
 
I'd want to have a method to put and get data into memory, as it was a file, but in memory. As I have seen, I only can use filestream and stringstream ? Thank...
[3 replies] Last: I guess you could have a buffer and then write that.. Though I don't ... (by hamsterman)
by lufus
Modify every 3rd line of a text file
 
Hi, I'm new to the site. I have a problem that I'm having trouble tackling. I need to modify an existing text file by replacing the first character of every t...
[10 replies] Last: The stream has a 'seekg()' function for reading and 'seekp()' for writ... (by coder777)
by linch
reading tabulated data
 
Hello guys, I'm a complete C++ newbie an experience some difficilties. I want to read tabulated data and store it in a 2D array. Sounds quite easy. I've got ...
[10 replies] Last: Well, it works for the first file, but closing the file doesn't work ... (by linch)
by tonnot
Can i create 'cout' objects
 
I'd like to create cout (ostream) objects (in example, cout1, cout2,... even a vector of 'couts' ) But I cant, compiler ask me some parameters.... I dont ...
[3 replies] Last: Have you looked at http://www.cplusplus.com/reference/iostream/strings... (by hamsterman)
error LNK 2005... already defined....Please help
 
I'm getting this error... 1>drive.obj : error LNK2005: "struct info h" (?h@@3Uinfo@@A) already defined in BubbleSort.obj 1>HeapSort.obj : error LNK2005: "stru...
[5 replies] Last: "Unresolved external symbol" indicates that the linker cannot find a c... (by Moschops)
by Majeth
Problems outputting to .txt
 
int writeFile (int prime){ ofstream outputFile ("primary.txt"); outputFile.open ("primary.txt", ios::out | ios::app); outputFile << prime << "\n"; ou...
[2 replies] Last: yeah, the int-return 0; is a bad habit of mine, I'm sorry to say. Th... (by Majeth)
by tmtt
how i can find size of dynamic array in c++
 
how i can find size of dynamic array in c++?
[1 reply] : You can't. You have store it somewhere when you allocate the array. Or... (by hamsterman)
Why pass arrays by reference?
 
The following two function prototypes correspond to passing an array to a function (1) by "value" (i.e., pointer) and (2) by reference parameter,. void funct...
[2 replies] Last: Very clear explanation, thank you. (by snufflehound)
Can someone please write a C++ code for this question using safe user IO, arrays, and dynamic memory?
 
Examine the two searching algorithms designed to search an array of numbers provided and provide written answers to the following questions. Linear Search Algo...
[1 reply] : http://www.cplusplus.com/forum/beginner/1/ (by webJose)
May 2011 Pages: 123... 48
  Archived months: [apr2011] [jun2011]

This is an archived page. To post a new message, go to the current page.