#Help with some c

28 messages · Page 1 of 1 (latest)

hollow ingot
#

I want to copy text in one array to another how do i do this my attempt is above

granite patrolBOT
#

When your question is answered use !solved to mark the question as resolved.

Remember to ask specific questions, provide necessary details, and reduce your question to its simplest form. For tips on how to ask a good question use !howto ask.

#

@hollow ingot

Screenshots!

Your message appears to contain screenshots but no code. Please send code and error messages in text instead of screenshots if applicable!

hollow ingot
#

[{

"owner": "C/C++: IntelliSense",
"code": "137",
"severity": 8,
"message": "expression must be a modifiable lvalue",
"source": "C/C++",
"startLineNumber": 235,
"startColumn": 9,
"endLineNumber": 235,
"endColumn": 20

}]

dire geyser
#

what is textToPrint defined as

hollow ingot
#

char textToPrint[numOfLinesInSpecifiedFile - 1][256];

dire geyser
#

since you cannot copy an entire array by assignment you have to do it component wise

#

arr[line][character]

hollow ingot
#

how do you mean?

#

char by char?

dire geyser
#

yes

hollow ingot
#

oh ok

#

thankyou

dire geyser
#

!man strcpy

granite patrolBOT
#

strcpy, strncpy - copy a string

Synopsis
#include <string.h>

char *strcpy(char *restrict dest, const char *src);
char *strncpy(char *restrict dest, const char *restrict src, size_t n);

dire geyser
#

does the same thing but its a stdlib function

granite patrolBOT
#

@hollow ingot Has your question been resolved? If so, type !solved :)

hollow ingot
#

1 more thing right

#

i am trying to delete a file

#

using remove()

#

so im making two different feature in my rextmanagement fprogerm

#

1 feature is delete file

#

and another is delete line

#

what i have done with delete file i have used remove() and it works fine

#

now im trying to implement the delete Line

#

i cant use remove because