Beginners - July 2010 (Page 18)

can we assign const char * to string
 
Hi i m tring to assign const char * to string its giving core dump(runtime error)...........
[3 replies] Last: void setRetransServerSourceId(const char* str) { m_RetransSourceId = s... (by rohandreamworld)
Overload operator<< for ostream and wostream
 
Hi all. Let's say I have a class, Foo, that I want to be streamable to an ostream. So I write this. #include <string> #include <iostream> class Foo ...
[2 replies] Last: I could not get the above one to compile. The following seems to work... (by binarybob350)
Desktop Focus
 
Hi I'm new to C++ and I'm trying to make a simple program that buffers text and presses the windows button for me whenever I finish typing "on the desktop". ...
[2 replies] Last: Wow thanks that part is working now : ). The console in thing was jus... (by Robert265)
getch() inside a function
 
Hi all, I am learning to programm in C++, for now with the nucrses library. I have a small problem that has taken me a full day so far without reaching a sol...
[2 replies] Last: Thank you very much hamsterman, works perfectly now. Have a very... (by wboustany)
splitting input into digits.
 
For example if someone enters $999.99 how do i split it into the 900 part , 99 , and the 99 cents? so it will read out like a check. (nine hundred ninety n...
[4 replies] Last: double *input = new double; [...] delete input; input = NULL; ... (by Athar)
by dasman
char *
 
char *s = "abcd"; creates a char pointer that points to beginning of "abcd". why does my program crash when I do this *s = 'z'; I suspect it crashes be...
[4 replies] Last: Declaring the following and then changing it is bad practace. If you ... (by binarybob350)
expected init-declarator?
 
I can't figure out how to get rid of this error. The trouble is on line 44. Does anyone have any idea what's wrong? It's probably something simple, but I have n...
[5 replies] Last: @ kaduuk Thanks a lot, it run fine by adding ; after double circl... (by Muhammad Qasim)
why does this simple program work?
 
Hi, so here is the code for a 'Guess My Number' game. But the 4th line up from the bottom confuses me. Surely the operator used should be == and not !=. I t...
[1 reply] : oh nevermind lol I just realised why it works. Obviously the program i... (by JackoThe1st)
Critique my code please?
 
Hi, I'm a beginner at C++ and am doing Introduction To Programming at University (night school). I'm also working through Walter Savitch's Absolute C++ in my o...
[7 replies] Last: Things become intuitive, and once you start to learn more about the de... (by RyanCaywood)
A length converter by a noob
 
This is a Length Converter that I made (i am a 14 yr old noob) and I would like to know if there is anything I need to fix or I should change to make it better....
[11 replies] Last: oh shit... shoulda looked at your post mgupta. (by jammas615)
How to create from structure a class
 
Hello. How to create from structure a class? There is a ready code with class usage.Ide wxDev-C++. headerfile: //golfobj.h #ifndef GOOLF_H_ #define GOLF_H...
[7 replies] Last: English is not causing the problem... the question is not clear as to ... (by mgupta)
Open Control Panel\Network and Internet\Network Connections
 
Hi, how can I open this: Control Panel\Network and Internet\Network Connections I tried with ShellExecute() but I think I did it wrong. Please help, th...
[9 replies] Last: i think you should search for the netcpl.cpl file first on your machin... (by bobito)
How do I get the things I write to work on other peoples computers?
 
Oh good god, I found out that there's a tutorial on the Start Page of Visual C++ 2k8 that explains how to create a freestanding program. Once again, I ask a que...
[3 replies] Last: [quote=firedraco]Did you mean '\n'? No, he just forgot a cin.get(an... (by m4ster r0shi)
project
 
i have a project due for school in a couple weeks. it can be almost anything. but it has to have these criteria. •File input/output (I/O) •Selection ...
[3 replies] Last: That's what I have in mind... #include <iostream> #include <fstre... (by m4ster r0shi)
2 dimensional array
 
I have the following sample code: #include<iostream> using namespace std; int main(){ int **m; m= new int* ; for(int i=0;i<10;i++) {...
[3 replies] Last: There's no need for such macro hackery in C++: const size_t PtrArr... (by filipe)
random generator generating same value
 
Hi there. The problem: I have a random generator function which every time its called generates the identical number. When I used this same function in a prior...
[3 replies] Last: Yep, works great. Thank you very much. (by AlphaBravo)
by kid
Beginner : Read n, sum even numbers until exceeds n
 
Hello.I am trying to make this program work. Because I am learning by myself c++ my only option to ask question witch I don't know the answer is on the internet...
[3 replies] Last: #include <iostream> #include <conio.h> using namespace std; ... (by kid)
Sorting method and computation time
 
This is my assignment: Write a merge sort function. Test it with 100,000 numbers (I'm only using 100 right now). Print the time used to complete the sorting. E...
[1 reply] : Nevermind lol. I figured out what was wrong. In line 22 i had c inste... (by SteroidalPsycho)
One of two input variants
 
Hi, I need to convert digit into spelled-out(eg. "0 is zero") or spelled-out to digit ("four is 4"); To do this i need to read in int or stri...
[3 replies] Last: stringstream could also be handy here: #include <sstream> #includ... (by m4ster r0shi)
ifstream error
 
Compiler Error- No more ideas- need some fresh eyes. Declaration: #include <string> #include <stdlib.h> #include <iostream> typedef char *charptr; ...
[14 replies] Last: Thanks all! Problem solved. (by stavros)
July 2010 Pages: 1... 1617181920... 31
  Archived months: [jun2010] [aug2010]

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