Beginners - March 2011 (Page 25)

Modifying string inside a method
 
Hi, I want to change the string inside a method. I wrote following code but it won't do it. void change_string(const char * the_string) { cout << th...
[4 replies] Last: I don't want to modify it. I want to allocate new location for that ch... (by rajimrt)
logical error
 
Hi, I'm new to c++. We just started on logical errors. I'm struggling to restructure this code so as to remove all the logical errors. int x = 2; for (int y...
[9 replies] Last: int x = 2; for (int y = 0; y <= 5; y++ ) { cout << x << " " <<en... (by matsom)
Pointers
 
given an integer array ugly and a pointer iPotr that points to it via the assignment statement iPotr = ugly; My question is to print each element of the arr...
[1 reply] : Those should all give you the same output, at least from what I can te... (by hanst99)
working quiz program
 
hey guys I recently made a quiz program to make a quiz(duh) for school and I figured I would share the code with you guys. Its an class so read this first: htt...
[3 replies] Last: I considered doing a few of those things but when i made it I just nee... (by bboy212)
by Marek
For (Counting)
 
ok i think i know about counting forward, as i know it should go like int a = 10; int b = 0; for (i=0,a<10,i++){ b++; } cout<<b; but now how...
[2 replies] Last: something like... for (i=a,i<c,i++){ (by strongdrink)
by gchatt
word search
 
can anyone help me figure out why this is not working. its a program that reads a file and searches for a specific word. i can get the total number of words in ...
[1 reply] : Welcome, read before posting. http://www.cplusplus.com/forum/beginn... (by hanst99)
URGENT
 
Urgent can anyone give me a pratical example where unions can be used to avoid C++ type checking ?
[1 reply] : I don't know if that could be done quickly but I can show you how a Un... (by Computergeek01)
Button +1 Clicker Visual Studio C++
 
Hi all I am using Visual Studio C++ 2010, I am creating a Windows Form and I have a button "button1" that when I click I would like the txt box underneath "tex...
[1 reply] : What has happened is that your IDE has created a function for you. Thi... (by Duthomhas)
by beakie
pointers
 
I have written the following... int strlen(char* _String) { unsigned int iLoop = 0; while(true) { if (_String == 0) { return iLo...
[13 replies] Last: Guarantee the user? The user is me. I know I won't change it. Sorry, ... (by Disch)
Returning false
 
Look at the following code: if (!GameEngine::GetEngine()->Initialize(iCmdShow)) return FALSE; // Enter the main message loop while (TR...
[11 replies] Last: That's right, because the return statement terminates the function rig... (by Zhuge)
Having inheritance problem
 
Hi, I have 3 classes. Parent class is Sprite. It goes like this: class Sprite { ... } class WorldOBJ: public Sprite { ... } class Player: publi...
[5 replies] Last: It was an IDE bug. I just restarted it and it works. (by Akill10)
Really EASY problem to solve.....
 
How do I declare a variable that CAN be changed but can be used in all functions of a program? Like if I declare a variable in main, I can't use it in main2, g...
[10 replies] Last: I was going to give helpful input but when people on forums complain a... (by bboy212)
General Method
 
My class makes a Initialize(int iCmdShow) function to hide some of the dirty work which winmain has to do, and its code is this: BOOL GameEngine::Initializ...
[8 replies] Last: [quote=I]Are you making a class that implements the basic tasks of reg... (by closed account z05DSL3A)
strcpy_s
 
Hi I have the following code in an existing project: CString cString = "blah blah"; char *pBuffer = new char ; int bufLen = cString.GetLength()+1; m...
[1 reply] : Don't use strcpy_s, it's non-standard. The standard function are str... (by Bazzy)
How does a compiler actually send the code to the processor?
 
I want to know how because as weird as this sound I feel distant from my x86 Intel Celeron and I want to be able to know EXACTLY how the compiler converts codes...
[15 replies] Last: Assembly would translate into OpCode yes. I worked with OpCode on an e... (by Computergeek01)
simple quiz program
 
Hello, I very recently started programming c++ with little programming knowledge. I wrote this program in order to make a simple quiz. #include <string> ...
[3 replies] Last: Of course, glad to help. (by ultifinitus)
How to add the correct options to the g++ command
 
my os : windows xp sp3 compilers : gcc 4.5(minGW) IDE : code blocks 10.05 I want to make the "CImg.h" work by code_block 10.05 but it always give me an er...
[8 replies] Last: with C::B checkbox I also try to type it on the command window g++ -... (by stereoMatching)
adding text in a windows program
 
I know how to use std::cout, but where do i add it if i'm making a windows program
[11 replies] Last: I want this program to be able to run in a windows window #inc... (by closed account SEbXoG1T)
error: undefined reference to vtable
 
#ifndef AHASHMAP_H #define AHASHMAP_H #include "LinkedHashEntry.h" #include <iostream> using namespace std; const int TABLE_SIZE = 128; class aHa...
[1 reply] : Could you post LinkedHashEntry.h ? (by hamsterman)
by ghoti1
Function Question
 
In this program, it's supposed to read data from a file, prompt user for a word to search -like google- count the total words and number of occurrences that th...
[1 reply] : I assume that since eof was reached in returnTotalWordsInFile, returnN... (by hamsterman)
March 2011 Pages: 1... 2324252627... 52
  Archived months: [feb2011] [apr2011]

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