Beginners - July 2013

Initializing Object
 
Hi guys, I know this is a stupid question but could someone give me an answer. I know that this code is illegal struct A {A newA;}; But I do not under...
[4 replies] Last: Thanks for the reply everyone, helped a lot. (by Longazan)
Storing object of linked list in an array to get adjacency list
 
Hi I have a set of nodes from a graph structure that I input through text file and represent it in a linked list.My nodes also contain some weights.Every nod...
[no replies]
public versus private
 
Somewhere here, i dont remember where exactly bjarne stroustrup says that the idea of implementing private variables was an idea they had back then, and it was ...
[4 replies] Last: I dont really understand the purpose of getters and setters either? w... (by MikeyBoy)
Libraries
 
This question is bothered me alot. how i can use libraries in visual c++ 2012 i got alglib library http://www.alglib.net/ for example please i need an explanat...
[5 replies] Last: you need to tell Visual studio where to find the library files. It's ... (by closed account z05DSL3A)
recursive blob finder
 
i have to write a recursive function to count the number of blobs (grouping of characters) that are in a file. it is counting 7 blobs instead of the 6 that it s...
[1 reply] : If you want to check if something is equal use == instead of = Not sur... (by kevinkjt2000)
aborted core dumped
 
What does this error mean? I singled it down the me using string.substr(), but i dont see the error. I put a small snippet up testing that for an error, but i g...
[2 replies] Last: ah ok thanks vlad (by metulburr)
Running a program
 
How would i run a program from another computer, say, if it didnt have dev-c++
[5 replies] Last: I got it to work thank you (by nolannpm)
Why is this wrong?
 
Im using c language. It says theres a syntax error before on the second printf. #include <stdio.h> #include <stdlib.h> int main(int argc, char *argv ) {...
[3 replies] Last: Thank you that fixed it (by nolannpm)
by nmn
string class
 
I am learning how to derive from string class. one of my constructor is as follow: String::String(char s){ char* S = &s; buf = new char ; length ...
[11 replies] Last: thanks cire....this is what I was looking for: std::strcpy(newBuf+len... (by nmn)
validate
 
validate strings
[5 replies] Last: I am sure that you did not do what I showed. As the result your code w... (by vlad from moscow)
Fixing compiler error C2228 left of " " must have class/struct/union
 
Hey guys I have my code all written but keep getting the error message "error C2228 left of " " must have class/struct/union. This is the only error message I ...
[6 replies] Last: Got the errors to disappear, thanks Alrededor! (by treefrog)
Unresolved external symbol error
 
I am getting these errors with my code and I don't know how to fix them, any help? The errors are on lines 54 and 55. 1>------ Build started: Project: Chapt...
[5 replies] Last: Are you asking me?! I do not know. They are your functions. if you de... (by vlad from moscow)
by Ludidi
Implement a recursive function to reverse a sorted array.
 
Implement a recursive function to reverse a sorted array. Ie, given the array [ 1, 2, 3, 4, 5] your procedure should return [5, 4, 3, 2, 1]. int revers...
[2 replies] Last: @kingkong200 Your function does not reverse arrays. And moreover ... (by vlad from moscow)
Data structure gives error LNK2001
 
Greetings, I'm having issues with constructing structures. I am using the SFML library, but that doesn't seem to be the issue. This is the code that cause me...
[5 replies] Last: I have fiddled around a bit more with the code I had, and removed the ... (by Constipator)
Why do we have to assign a value while using while loop
 
I saw a program in my CS book whose source code is:- #include <iostream> using namespace std;   int main() { char choice=‘y’; //why is this req...
[2 replies] Last: In the line 14, the user must enter any variable, then where will it s... (by closed account jNhkoG1T)
c++ database delete all the data before "fin"...
 
This code gets data from a file and stores them in a vector(or actually it has to get data) but it deletes the data in file and gets nothing... //Here is...
[5 replies] Last: It helped... Thanks to both of you (by Albo Coder)
tricks to make things faster
 
Are there tricks to make things faster. I mean, if i wanted to write code fast i would just use Python. The reason i am dabbing into c/c++ is to get a glimpse o...
[8 replies] Last: thats not true well at least not 100% of the time. it depends on the c... (by closed account Dy7SLyTq)
Lvalue required? [C]
 
Getting a Lvalue required error in this line: acct.pin = pina; Both acct.pin and pina are string variables. Not sure why, but I didn't encounter that erro...
[4 replies] Last: I'd still love to know why I got the lvalue required error... It's j... (by Cubbi)
by ahchua
Generating set of months
 
How do I construct a random set of months using pointers? I've created the function but it seemed to be repeating itself in the set. How can I prevent that? Wha...
[1 reply] : you need to seed rand srand((unsigned) time(NULL)); (by closed account Dy7SLyTq)
Input Multiple strings at once?
 
Is there a way to have a user input a line of text (with spaces) and have after each space represent a new string? I know that between each space there will alw...
[1 reply] : #include <iostream> #include <stringstream> #include <vector> #inclu... (by closed account Dy7SLyTq)
July 2013 Pages: 123... 53
  Archived months: [jun2013] [aug2013]

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