How would I do it without strncat? X += y[i] or something?
I need to do it in a loop because it checks if each stage is valid. For instance, where Y = 802143735:
X=8
valid? no
X=80
valid?...
Type: Posts; User: Yinyang107
How would I do it without strncat? X += y[i] or something?
I need to do it in a loop because it checks if each stage is valid. For instance, where Y = 802143735:
X=8
valid? no
X=80
valid?...
Oh yeah, good point.
I need to append one character from C-style String X (not necessarily the first char) to C-Style String Y. I was thinking of doing it thusly (this is in a for loop):
strncat(X, Y[i], 1)
where...
Woops, I read 'ISBNPrefix" but didn't think to check whether it was the .h or .cpp; the line I gave before was wrong, then.
ISBNPrefix.h is short, minus comments, so I'll post the whole thing.
...
I have
#include<iostream>
#include<cstring>
#include<cstdlib>
#include<stdio.h>
included on one .cpp, and
#include<string.h>
#include<cstring>
#include<iostream>
#include<cstdlib>
I'm getting the error " 'FILE' not declared in this scope" many times while compiling my program, as well as " 'FILE' does not name a type" twice. I think one may be a product of the other.
...
Only two, both looking for integers, though I do have fscanfs.
Thanks ever so, tabstop.
That's what I tried before; it ends up making it worse. Specifically, with the extra line of code, it never accepts my input at all.
I have this function, which is meant to get a user's input, validate, and translate it to an integer:
int menu(){
int rv = 0;
char in;
do{
//Display...
Argh, again with the single-character mistakes >.< Thanks guys.
And no, my compiler didn't say anything.
The program's supposed to check if the entered string has embedded spaces (FYI, by the prof's definition, "Te xt" has embedded spaces, while " text" and "text " do not, hence the extra bits of code)....
Thanks, Adak. I knew it would be something silly like that.
It's for a school assignment. I have no clue what's going on, but it prints "1077936128" for friends_helped and "0" for coins_earned, despite the fact that the vars being received are 1 and 27,...