Beginners - January 2012 (Page 12)

Syntax of reference pages
 
Could someone help me understand the syntax of functions on the refernce pages? e.g. The atoi() reference page has this underneath the title, int atoi ( ...
[1 reply] : it tells you that svariable must have the type const char * or a ... (by Cubbi)
how two c++ programs can communicate?
 
Sorry for this "newbie" question... I have not c++ experience whatsoever (yet). I know only some BASIC dialects and little Python. But I'd like to know how p...
[1 reply] : This is called IPC (inter-process communication) and is far from simpl... (by mik2718)
Frustration with first foray into template classes.
 
I am a newb to C++'s template class mechanism and am having problems with something probably has a solution that will make me feel stupid. Oh well. So I hav...
[2 replies] Last: If you're trying to write party ->manageEquipment(); and have it ca... (by Cubbi)
Switch Statement: Setting a variable
 
Hi, This should be really easy- what am I doing wrong? Why wont the switch statement set the variable- is it out of scope? How can I fix it? #include <ios...
[6 replies] Last: Thanks for your help- I reworked the while and fixed the case statemen... (by closed account NU9GNwbp)
by kempy
if statement to set calendar on right day
 
im trying to write an if statement to start my calendar on the write day i wanted it to say something like if(startday=2) cout <<setw(8); but i need...
[2 replies] Last: mmk so how can i make it to where if a day starts on a tuesday, the da... (by kempy)
const char, char const
 
Hi! simple question is this: char const* str1 = "str1"; the same as: const char* str2 = "str2"; ? I believe it is since whenever I try to do str1 ...
[11 replies] Last: Warning: delete is used improperly, a memory leak will occur. (by modoran)
'Random Number Guesser' game (w/ functions)
 
I'm having trouble creating this. I've looked at a few tutorials and other 'help' posts online but they all have the code in the main method and I was under the...
[6 replies] Last: Thank you stew. Another question I have is why isn't function 'add_a... (by Logik22)
I am having trouble reading and writing files
 
This is a basic c++ project I am working on. It is supposed to be a message coder/decoder; I want to take a string and translate it to ansi values or take a blo...
[4 replies] Last: Thanks, I understand now. and the initial problem is solved but now wh... (by tempneff)
What is this doing?
 
I'm maintaining code that I didn't write and there is a struct in which an item is the name of the struct with parens (see below). What is this feature doing? ...
[1 reply] : It looks like a constructor for the structure. (by Texan40)
Why would the addition of an 'if' statement makes the program skip the getline
 
This program works fine if I don't use a if/else or switch. I am sure it has to do with the getline() function. When I switch to cin>> it works with the if/else...
[1 reply] : You really should learn to use indentation. It makes it much easier to... (by Peter87)
Trying to make the program work for class, someone please point me in the right direction...
 
Please I just need some help finding out why the surface area is not coming out correctly. I just started the class a few weeks ago and i know it is probably so...
[6 replies] Last: Alright thanks guys, I just went with the equation that was on my assi... (by ctittle)
Class/Inheritence Help Please
 
I want this program to only write int holy (jesus) when tan::type == 0 but i keep getting a syntax error: if and unexpected skipping function body error, any he...
[no replies]
Does anyone know why this read function won't work?
 
I have a function that Reads a file called "videos.txt". For some reason it is not reading the text from Videos.txt. Does anyone see a problem with the code? I'...
[no replies]
A simple problem of storing ...
 
I know , it may be childish question but here it goes :- I am trying to store value of int variable along with space . Ex - if a is an int & b is an string , ...
[6 replies] Last: Okay , thankyou , i have got it ! (by Maggi Iggam)
fstream problem
 
if i comment out if (strlen(x)!=strlen(Q)){ //compare length of the two char and return false if != return false; it will run smo...
[1 reply] : What are the values of input_line? Maybe you should print them to deb... (by kbw)
by nomi
compare char in matrix
 
hi, i got the next error: argument of type "char" is incompatible with parameter of type "const char *" the error is about the next row: if(strcmp(ma...
[3 replies] Last: Basically @hamsterman said that since your matrix contains char s you... (by eypros)
I need to code a symbolic differentiation program :s
 
Ok... I'd like you guys to give me a hint... I need to resolve big functions, only explicit ones [ex: f(x)=(x^2+x)/(1-x)^2], I'm a CPP beginner... Some g...
[3 replies] Last: > I'm not asking for a code, I'm asking for ideas... Assuming that yo... (by JLBorges)
by Taylrl
Very simply reading in data :-) ......then into a vector (1,2)
 
Hi, I have some coding experience but am relatively new to c++. I am quite simply trying to read in some numbers I have in a .txt file. They are in a column ...
[28 replies] Last: Finally cracked it! I knew it would be something stupid somewhere. ... (by Taylrl)
Passing arrays as a constant reference parameter?
 
I have an assignment which asks me to "Make sure to pass the array as a constant reference parameter"....what exactly does this mean? What's it asking me to mak...
[4 replies] Last: IMHO, prefer using a typedef; makes it a lot more readable. enum { N... (by JLBorges)
In for loop and arrays
 
int x=0; int array ; int arr ; cout<<"enter 5 numbers"<<endl; for(int i =0; i<5; i++) { cin>>arr ; ...
[1 reply] : int x = 0; int array ; int arr ; cout<<"enter 5 numbers"<<endl; fo... (by ThangDo)
January 2012 Pages: 1... 1011121314... 48
  Archived months: [dec2011] [feb2012]

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