General C++ Programming - December 2010 (Page 3)

by jaguar
making a list of names
 
i am trying to write a program that that accept list of names in vector, write them out, remove a name, sort the list save it to file. wondering if i could get ...
[2 replies] Last: thanks hamsterman here is my forst code. we can start from there. ... (by jaguar)
Question about roy-warshall algorithm
 
What is the main logic of roy-warshall algorithm on trasitive closure of set and how we use this algorithms on conflicts problems Regards
[1 reply] : http://en.wikipedia.org/wiki/Floyd–Warshall_algorithm (by hamsterman)
by hannes
array of pointers to functions
 
Hi, I know how to make a pointer to a function, something like this: double (*function)(void); This creates a pointer to a functions which takes no a...
[1 reply] : typedef int ( *ptr2Function ) ( int ); ptr2Function arr1 = {... (by srinathduraisamy)
by dkaip
Problem with getline
 
I am in windows xp, gcc, codeblocks. When run the cout<<textFile<<endl; gives c and the file not opening. Where i have the error? Thank's vector<st...
[3 replies] Last: Ok i just open, many thank's. (by dkaip)
Can't use printf, have to use cout?
 
Why can't I store text in a string and use printf() to output whatever is stored in there? I'm only doing this, because I'm trying to pass strings to another f...
[6 replies] Last: http://www.parashift.com/c++-faq-lite/input-output.html#faq-15.1 http... (by Duthomhas)
Reading text into integer vector
 
Hi everybody, I really need that code, I have a text file 32 4 12 13 4 12 0 0 0 0 0 3 2 3 4 and I want to convert it vector or array like A ={3...
[3 replies] Last: You are kidding, right? You are mixing C and C++ I/O (don't do that if... (by Duthomhas)
Issue with string length
 
Hi, I have a simple code which takes an integer, and for each byte of integer is concatenated into a string. ---------- unsigned long a = 0x123456781234567...
[1 reply] : you are treating " a " as a null terminated char string, which is not.... (by Bazzy)
by Doth
Visual C++ Question
 
I was using Dev-C++ till now , everytime i made a misstake the line was highlighted in red. Now i started using Visual C++ 2008 build shows 1 failed but it doe...
[2 replies] Last: Thank you , its working now. (by Doth)
replace all '.' to space in a string?
 
I have an ip address represented by a string like "192.168.1.1", is there any simple ways for me to conver all the '.' to spaces in this string? string ip("...
[2 replies] Last: Easiest way, IMO: #include <algorithm> string ip("192.168.1... (by jimc)
Rocks Papers Scissors always picks rocks
 
I wrote a Rocks papers Scissors game with an assumption that -when the opponent wins the last game, he uses the same move the next game -when the opponent loo...
[2 replies] Last: Can't believe I missed that, Thanks!! :D (by waqqassheikh)
by nipolo
is there such a function
 
I want to know if there is such a function that can substitute the fragment: Return_type function() { Return_type result; cin >> result; retu...
[3 replies] Last: No, your choice of a priority_queue () explicitly removes any such po... (by Duthomhas)
What does this mean?
 
Greetings All I'm battling to understand the following code segment: float m,n,gamma; ... ... float y1 = (n - m & 1 ? -gamma : gamma); m, n and ga...
[4 replies] Last: Brilliant. That makes sense. Cheers! (by RichBMB)
OpenGL question
 
I have this OpenGL program. Can it work, what it does , (is not done by me, it was generated by my wxDevC++) /************************** * Includes * ...
[1 reply] : It works fine. What was the question? (by hamsterman)
can some1 try 2 correct these codes...
 
#include<stdio.h> #include<string.h> #include<stdlib.h> char letters ={'a','b','c','d'}; int unique(int i, int n ); void shuffle(){ int i, a, n ; cha...
[2 replies] Last: what errors does it have? let me rephrase, what kind of errors are ... (by Seraphimsan)
macro define and return value
 
hi all, i came across below codes which i don't understand. appreciate if you can provide some explainations. what is the meaning of defining "0x1"? wha...
[7 replies] Last: thanks guys for your info. appreciate that. (by pathfino)
trouble with structs
 
ok im writing a program and in it it has two files im trying to access an array from the second file wich is declared within a struct but when i compile i get 3...
[3 replies] Last: to-may-toes to-mah-toes (by ne555)
lower to upper (1,2)
 
i wanna to make a prog which convert small case letters entered by user to upper case letters....i TRIED to use toupper function ...but it only do action with ...
[24 replies] Last: Exactly Joe, your solution only works on one computer, which is why ... (by rocketboy9000)
strings in c
 
Guys all i want to know is how to do this, for example i have a string "experiment", in the word "experiment" we can make a word "ten", "mint", "rent", "time" a...
[11 replies] Last: you guys are all genius tnx for the help :D.. sorry beacuse its my fir... (by joeneldeasis)
Static linking libraries
 
I'm trying to remove the dependency on libgcc_s_dw2-1.dll and have been trying to static link libgcc to do so. I'm using Code::Blocks using the MinGW compiler ...
[8 replies] Last: This is exactly what I need. Thanks alot :D (by closed account 1yvXoG1T)
a text encoder
 
I wrote this encoder program a while back. The program originally used two different text files and a different logic. the program worked fine. I recently i...
[5 replies] Last: i dwnloaded devc++ but i cant compile Anything at all i keep o... (by soumyaxyz)
December 2010 Pages: 12345... 24
  Archived months: [nov2010] [jan2011]

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