General C++ Programming - February 2011 (Page 22)

Setting the active database using mysql C API
 
how do I set the active database after logging in mysql_real_connect( conn, "localhost", "username", "password", NULL, 0, NULL, 0 ); mysql_query( conn, "cr...
[1 reply] : http://dev.mysql.com/doc/refman/5.0/en/mysql-select-db.html (by guestgulkan)
by abakiz
Basic Object naming problem
 
I'm trying to create a list of objects that change name every time they are created. I.e, Square1, Square2, Square3 For some reason it's giving me the err...
[15 replies] Last: Anyhow, thanks a lot for that, I was trying to figure this out all day... (by abakiz)
program parameter style
 
A simple question, perhaps of taste: If you want to define a program parameter that can not be altered at runtime, but might be altered as you test the progr...
[1 reply] : Use a global constant probably. It's better than a define in this c... (by firedraco)
pointer to map
 
Hello I want to create an array of map structures. i am using the bellow code but it seems that I doesn't work ///// typedef map <double, double> mapda...
[4 replies] Last: mapdata** point = new mapdata* ; point = new mapdata; points ->ins... (by hamsterman)
Linker Errors
 
Well, I've got linker errors (I think...) and i need some help to solve them. I've written these going by what i have learned from the internet sense my program...
[3 replies] Last: Ok so i figured it out. In my func.cpp file i have to have: std::o... (by okimdone2)
by Fumomo
Adding values of duplicated arrays and replacing
 
Hi all, I was hoping for some help and hints to the problem i'm facing now. Right now i have a a 2D array which stores the elements: 22Jan11 180 11Feb11 ...
[1 reply] : A multimap would be a more appropriate data structure. (by kbw)
sinh(3391014490.0)
 
Hi guys, I want to evaluate sinh(3391014490.0) as i'm doing numerical simulation. It produces inf and RR: overflow in NTL (i used (0.5)(e^x + e^-x)). Anyone ...
[6 replies] Last: Wolfram Alpha is neat. (I found a way to break it, though. :P) Do t... (by Kyon)
Deployment problem
 
Hi, I made a DirectX demo for my portfolio and now I'm trying to add it to my website so prospective employees can download it and see what I can do. My prob...
[no replies]
by asuri
Storing 1 as 01 in array
 
Hey guys, so as the title suggests I am looking for a way to store 1 as 01 or any number of 0 as prefix. Is this possible for an int array? Thanks.
[4 replies] Last: I fixed the problem, used a string array and used the insert() functio... (by asuri)
insert a data to list in c++
 
I have a function: void list_insert (struct lista *head,int n,int k) { struct lista *wsk=head; if(wsk==NULL) {wsk=new li...
[6 replies] Last: is that program correct?? struct lista { int id; lista * next; }... (by elii255)
Output not displaying the cards when dealt.
 
Hi, My program logic is working great for five card poker game and hand contains a pair and iterated the loop to find how many times program ran until pair w...
[no replies]
by eye51
Problem: vector, algorithm
 
Hi, I have a requirement of arranging a vector in given format, Let say, I have an vector like this: vector<int> VEC; VEC.resize(16); Values are: ...
[12 replies] Last: Hi simeonz, hamsterman, jsmith, onur, Thanks for your all replies. ... (by eye51)
Getting and error but I don't know why.
 
Here is my slist.h: #ifndef SLIST_H #define SLIST_H #include"snode.h" #include"slistiterator.h" #include<stdexcept> using std::out_of_range; templ...
[5 replies] Last: Ok it works. Thanks for all the help. (by Neb1000)
sorting using "strcmp" command
 
Hi everyone, i'm new to C++ and i want to sort name alphabetically and i came up with this program but i'm having error. find my program below; can someone go t...
[2 replies] Last: i'm two errors, you are right about "str" identifier, the error is com... (by akounga2000)
Constantly updating cin statement in C++
 
I am creating an rpg style text game in C++. The game is running in a constant game loop that updates the screen 10 times per second. I am trying to figure ...
[5 replies] Last: @ bzb65 while ( 1 > 0 ) ? why not while (true) ? Also, hugely agr... (by quirkyusername)
by Katma
School project
 
I'm trying to do a CSC project that involves basic arithmetic problems to calculate the final velocity of a problem. he problem is, I keep getting error message...
[13 replies] Last: You rock, Wolfgang. Thank you so much. (by Katma)
by imzack
problem allocation of memory?!?! copy part of a sting....
 
Ok, so I am trying to read from a text file, I can converted each line into a string and print it one line at a time, that works. now i want to take part of ...
[2 replies] Last: FIXES (that I can find): #include <iostream> #include <limits> // ... (by wolfgang)
Using c++ in internet application
 
I have an application where you give me math I return answer. I would like to know what is the best way to put this in an internet application if it is all writ...
[3 replies] Last: CGI = Common Gateway Interface Simply put, it allows you to write c... (by sadavied)
How do I manipulate nibbles?
 
I want to be able to read and write nibbles. Also how could I make sure that all my nibbles go into a file an even number of times so that there is no crash(or ...
[3 replies] Last: Er, your file must always be a multiple of two nibbles long... so you ... (by Duthomhas)
Is C really faster than c++?? (1,2)
 
In my program the main complexity was because of reading from file and writing in the file . My program was taking 18 mins when i was using fstream objects but ...
[32 replies] Last: Oh, right, I forgot which end is "highest". Maybe "loosest" would be b... (by rocketboy9000)
February 2011 Pages: 1... 202122232425
  Archived months: [jan2011] [mar2011]

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