General C++ Programming - March 2014 (Page 7)

random number/array
 
//generate 5000 random number. //ask the user for the number they want to search in the array. //send the instruction to the function //function search for the ...
[3 replies] Last: i am sending the entire array. (by syedvasty)
Double Linked List handling problems
 
Hi, Ive done program that reads in coordinates from text file and stores them in double linked list. After coordinates are read in algorithm calculates its impo...
[3 replies] Last: it worked flawlessly after changing loop. Thank you very much Glandy (by marijus5012)
pointer deletions
 
i have class and one member variable ex class a { public: vector<double> * vec; void memfunc(); } void a::memfunc() { vec = new vector<...
[2 replies] Last: This is abuse of pointers and dynamic memory. There is no reason to us... (by LB)
help on using template function inside a class in a seperate function
 
i want to use a class to print data stored as vector or array with different data types. i also want the print function two take more than one vector or array ...
[4 replies] Last: You mean like : X.h file #ifndef X_H #define X_H class X { temp... (by nvrmnd)
by mm123
Need help with a function
 
Hi, I'm new to this forum as you can tell and I am also relatively new to coding. This semester I am taking a c++ course without any previous knowledge of co...
[3 replies] Last: You could use two maps, then. map<string, int> pointsForMap; map<str... (by booradley60)
issuse about “new vector”
 
class Example { public: void Push(string& roStr){m_oVecStr.push_back(roStr);} vector<string> m_oVecStr; }; Example* pExample = new Example(); string...
[2 replies] Last: thx @MikeyBoy (by theanne)
Scores,Maps and Text files
 
This was the assignment i received. I tried giving a try but I'm stuck and need some guidance. I look everywhere trying to learn more about maps and f streams t...
[no replies]
Linked List Errors
 
Hello everybody, I have this program that I created, where the insert and remove functions were used to edit a linked list with other values. I've fixed proble...
[1 reply] : Your `remove()' function is error-prone. If you set a breakpoint in th... (by ne555)
What do you recommend for (soon to be former) Code Warrior Mac OS users?
 
Greetings all, My wife and I both have used CodeWarrior for programming in C and C++ for years. However, our last Macintosh computers that can run CodeWarri...
[5 replies] Last: Another option is Code::Blocks, you can watch the contents of an array... (by TwilightSpectre)
segfault error on memcpy
 
Sample code: Constructor & Destructor: BipDB::BipDB(u8* framePtr, u32 frameSize): dlBip(0), framePtr(framePtr), frameSize(frameSize) { dlBip = new dlF...
[1 reply] : Don't use memcpy with new/delete: It will almost never work. Anything ... (by TwilightSpectre)
else without previous if
 
hi,i am new to c programming.after i compile my coding,get error else without previous if.so many times i try to solve this problem already..but this error st...
[4 replies] Last: Hi,i am new to c programming.. below show that my final project of my ... (by vinod walcott)
complie time error.
 
When I declare a pointer to card (to test) in main card *testtype the below code compiles with no error. but when I declare in main card test...
[3 replies] Last: Because you never called delete on the pointer, thus the compiler ne... (by LB)
Palindrome using 3 stacks
 
Hi, I want to use 3 stacks to check a word that user entered whether is it Palindrome or not. I have written this code: But I don't know how to use 3 stacks ...
[6 replies] Last: Can even be done with one stack http://ideone.com/S2HPpw If you are l... (by Smac89)
the state of variable in one expression
 
I thought that an operator performs a permanent change in a local variable. For example, if x is 00000000 00000000 00000000 00000011 (a 32 bit unsigned integer ...
[2 replies] Last: An operator doesn't "change" a variable/object/value. You could think ... (by xismn)
by rm5393
Function Call Error
 
I am having issues with calling from a void function on my cs assignment any ways to fix this issue would be greatly appreciated. All I get is contestant 2 is t...
[5 replies] Last: A control structure is anything that can alter the program's flow, suc... (by xismn)
Function Prototype
 
Hi, I'm a computer dummy taking my first (and likely only) computer science course and I've begun to really struggle. I thought my current project was going wel...
[4 replies] Last: @28 cout << "enter velocity of the rocket (m/s): "; @29 cin >> vel; ... (by kannanmj)
Trouble running an infix to postfix stack conversion program
 
I keep getting the same error messages every time on Visual Studio. I don't know where the error is originating. Basically I'm trying to convert an infix expres...
[2 replies] Last: Make sure all the .cpp files are added to your project tree in Visual ... (by LB)
by Frjoe1
Keys not working
 
#include <iostream> #include <windows.h> #include <conio.h> #include <ctype.h> using namespace std; int gameOn(){ #define UP 72 #define LEFT 75 #def...
[2 replies] Last: Just for fun #include<iostream> #include<conio.h> using namespace st... (by Chriscpp)
Shortest path maze solver algorithm
 
Hi guys! I'm working on a maze solving program. So far I got the program to solve a maze using the recursive backtracking algorithm. I represent the maze as vec...
[6 replies] Last: This doesn't do exactly what you want, but demonstrates BFS. Reads a ... (by ac517)
by Alby94
std::thread in Dev C++ 5.5.3
 
When I insert a thread in my code...the compiler reports me an error: "'thread' is not a member of std". I alredy activated the standard language -std=c++0x...
[3 replies] Last: i try to use the header ptrhead.h for create many threads...but the li... (by Alby94)
March 2014 Pages: 1... 56789... 36
  Archived months: [feb2014] [apr2014]

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