Beginners - February 2011 (Page 10)

by tonnot
Strange overload behavior for << operator
 
if have : myclass& operator << (std::string data); myclass& operator << (bool data); Ok I dont know what can be happen, but myclass<<"hello"; is proce...
[1 reply] : It's a pointer to char, pointers can be implicitly casted to bools. A... (by Bazzy)
by tonnot
My operator << cannot do nested actions
 
I explain it: I have : myclass<<"hello"<<"again"; or myclass<<"hello"<<int_value; My compiler says me : error: void value not ignored as it ought to...
[2 replies] Last: OK ! I solved it. For everybody who needs it : MYCLASS& MYCLASS::... (by tonnot)
by trevex
FuncPointer doesn't work
 
Hi everybody, I am in first year at uni and need to do a little c++ app... The problem is I have a Event Class: typedef void (*FuncDownPtr)(void); type...
[2 replies] Last: Thanks, helped alot! It's working now. (by trevex)
Passing structures to a function
 
I'm really lost on how to pass my structure to a function. Basically I have the listed structures, and I need to pass them to a function for conversion. Can ...
[1 reply] : The first error is pointing to the argument list on line 51. Your fir... (by closed account zb0S216C)
by chipp
fstream
 
i've tried using this code: #include <iostream> #include <fstream> #include <string> #include <conio.h> using namespace std; int main () { string c...
[9 replies] Last: from the Linux Programmer's Manual The use of EXIT_SUCCESS and EXIT_FA... (by ne555)
Different variable types in same array?
 
I'm trying to program an array that will store the latitude and longitude of a coordinate. Is it possible to store the N/S component and degrees in the same ...
[3 replies] Last: Update - moved to a different thread. Thanks for your help Bazzy! (by gatmalice)
Yrobot problem
 
hi everyone as u can see im new tp this forum and c++ i hae a litle problem with a yahoo autoresponse tool. this was not created by me, the original codewas ...
[1 reply] : Is this related to C++ in any way? (by Bazzy)
system("pause") won't work for me
 
error: 'system' was not declared in this scope I don't know why, please help me, thank you in advance. PS: I use Code::Blocks10.05, what do you guys use...
[10 replies] Last: SYSTEM() does not exists as function and Windows commands are not case... (by Bazzy)
by jfiore
fatal error LNK1104: cannot open file
 
I have been having a crazy problem since I started using visual C++. nomatter what my code is, occasionally when I make changes and try to rebuild, I get the e...
[7 replies] Last: probably there's something incomplete with your instalation process. ... (by chipp)
UDP client code switch to win32 console application
 
I am new to c++ and I am trying to send some data from UDP client to the socket and later take down that data in Matlab. I have downloaded some c++ code for vis...
[no replies]
by ts1000
error problem
 
no syntax errorsbut it shows up false everytime no matter what #include <iostream> using namespace std; // password int main() { char fName ; ch...
[8 replies] Last: @filipe: Sorry, got it fixed. (by alexanderswang)
Structured Programming
 
I've tried to run this code but my compiler said "undefined reference to addition(int, int) This is the first time I tried to run a program from different cp...
[4 replies] Last: How are you compiling? If you have an IDE it should do everything fo... (by Bazzy)
by tonnot
With a char buffer from file, must I work with it with c (not c++)?
 
I want to do something with the buffer related to extract 'string' data. If I dont want to duplicate memory resources, Must I to work with it using c? (not c+...
[1 reply] : Um, I'm a bit confused on your request, but are you looking for someth... (by Cuddly Kittens 11)
Using strings with scanf problem
 
I'm trying to use the scanf function to assign a user inputted string to a variable called run. Here's my int main() as that's where the problem lies: int...
[2 replies] Last: run is already a pointer (the name of an array converts to a pointer t... (by filipe)
by ts1000
parameters for random
 
i know when you put random there is no parameters but say i want it to pick 6 random numbers between 1 - 100 how would i do that?
[3 replies] Last: @empress: that's not standard C++. There is no iostream.h header in C... (by PanGalactic)
me again, tad confused with reading from a file?
 
okay in my program atm, it can create a txt file, i now want to be able to read from it and then later on edit it, but all i want to know is how to read from it...
[4 replies] Last: yep works thanks to myfile.getline ( name1, 80 ); :) (by thecrrrg)
by tonnot
Mybuffer is char , to analize it I have to use cstring or c++ string functions?
 
I have read from a file a char * MyBuffer (supose 65536 chars) I must to use only cstring functions to analize it to tokenize ?(using some conditions) or is it...
[1 reply] : You're probably expected to use strtok(). strtok() modifies the buf... (by kbw)
by tonnot
A Char * var used with math operators... what is ?
 
From c++ tutorial : char str = "This is a sample string"; char * pch; pch=strrchr(str,'s'); cout<<pch; --- string cout<<str; ...
[1 reply] : Both str and pch are actually pointers to char. Pointers to chars are... (by Bazzy)
Text Document
 
I want to create a text document program where I can store info in the text document and recall text I have put into a document already. However, I don't know ...
[3 replies] Last: The errors in bolded lines are because fstream constructors take char*... (by hamsterman)
Calendar Program
 
I'm writing a calendar program that ask for the the number of the month and the year and displays a calendar. My problem is that when it tries to print the cale...
[7 replies] Last: That may be because in daysMonth() and display() in your ifs you use =... (by hamsterman)
February 2011 Pages: 1... 89101112... 43
  Archived months: [jan2011] [mar2011]

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